Solution Dec. 8, 2006

Let f(x)\, be a function of a real variable with real values.
If x\, is irrational then f(x)=0\,
If x\, is rational m/n\, in lowest terms, f(x)=1/n\,
f(0)=1\,
Show that f(x)\, is nowhere differentiable.

Proof:

If f(x)\, is differentiable then its derivative at x\, is given by this limit:

f'(x) = \lim_{h\to 0}\,\frac {f(x+h)-f(x)}{h}\qquad\qquad (1)

Suppose x\, is rational. Take a sequence of irrational numbers that converges to 0, e.g., h_k = \frac{\sqrt{2}}{2^k}

f(x)=1/n\, for some integer n\, since x\, is rational.
f(x+h_k)=0,\, since x+h_k\, is irrational.

Using these values in (1) we get: f'(x)=\lim_{h_k\to 0} \frac{-1/n}{h_k} Which does not exist.

Now consider x\, is irrational.
f(x)=0\,
As we take the limit in (1), anytime h is rational the quotient is 0. So if the derivative exists it is 0.

x\, will have an infinite sequence of rational decimals which converges to it, e.g., for x=\pi\, we have:
x_k={3,31/10,314/100,3141/1000,\cdots}\,

Define: h_k = x_k - x\, and apply this to (1)
f'(x) = \lim_{h_k\to 0}\, \frac{f(x_k)}{h_k}
f(x_k)\ge 1/10^k,\, cancellation to lowest terms can only make the denominator smaller.
h_k< 1/10^k,\, so we have:
\frac{f(x_k)}{h_k}>1\,
All these large values for the quotient are in between values of 0 mentioned above. Therefore the limit does not exist.

\square