These functions like the Cantor function and the continuous-but-not-differentiable function are all well and good, but contrived - the only place you ever see them is as counterexamples. Here is a function that has many uses in Number Theory, and still manages to have a strange property or two. Let
$x=h/k$ with $h$ and $k$ integers, $k>0$. Define $$s(x)=\sum_{c=1}^{k-1}((c/k))((ch/k))$$ where $((y))=0$ if $y$ is an integer, $((y))=\lbrace y\rbrace-1/2$ otherwise. It is easily proved that the sum depends only on the ratio of $h$ and $k$, not on their individual values, so $s$ is a well-defined function from the rationals to the rationals. It is known as the Dedekind sum; it came up originally in Dedekind's study of the transformation formula of the Dedekind $\eta$-function.

Now for the strange properties.

Hickerson, Continued fractions and density results for Dedekind sums, J Reine Angew Math 290 (1977) 113-116, MR 55 #12611, proved that the graph of $s$ is dense in the plane.

With Nick Phillips, I proved (Lines full of Dedekind sums, Bull London Math Soc 36 (2004) 547-552, MR 2005m:11075) that, with the exception of the line $y=x/12$, every line through the origin with rational slope passes through infinitely many points on the graph of $s$. We suspect that the points are dense on those lines, though we could only prove it for the line $y=x$.

thiscommunity's answers and votes! $\endgroup$ – vonjd Apr 22 '10 at 14:24