ruler function
The ruler function $f$ on the real line is defined as follows:
$$f(x)=\{\begin{array}{cc}0,\hfill & x\text{is irrational;}\hfill \\ 1/n,\hfill & x=m/n\text{,}m\text{and}n\text{are relatively primes}.\hfill \end{array}$$  (1) 
Given a rational number^{} $\frac{m}{n}$ in lowest terms, $n$ positive, the ruler function outputs the size (length) of a piece resulting from equally subdividing the unit interval into $n$, the number in the denominator, parts. It “ignores” inputs of irrational functions, sending them to 0.
The ruler function is so termed because it resembles a ruler. The following picture might be helpful: if $\frac{m}{n}$ in lowest terms is a reasonably small rational number (which we assume positive). Then it can be “read off” on a ruler whose intervals of one unit size are each equally subdivided into $n$ parts measuring $\frac{1}{n}$ units each by

1.
running one’s finger through until the integer preceding it and then

2.
running through to the subsequent $r$th subunit, “leftover” from the division of $m$ by $n$.
On the other hand, an irrational number can not be read off from any ruler no matter how fine we subdivide a unit interval in any ruler.
References
 1 Dunham, W., Nondifferentiability of the Ruler Function, Mathematics Magazine, Mathematical Association of America, 2003.
 2 Heuer, G.A., Functions Continuous at the Irrationals and Discontinuous^{} at the Rationals, The American Mathematical Monthly, Mathematical Association of America, 1965.
Title  ruler function 

Canonical name  RulerFunction 
Date of creation  20130322 18:23:55 
Last modified on  20130322 18:23:55 
Owner  yesitis (13730) 
Last modified by  yesitis (13730) 
Numerical id  5 
Author  yesitis (13730) 
Entry type  Definition 
Classification  msc 26A99 