Weierstrass's Theorem

Theorem
There exists a real-valued function $f : \left[{{0}\,.\,.\,{1}}\right] \to \left[{{0}\,.\,.\,{1}}\right]$, such that:
 * $f$ is continuous;
 * $f$ is nowhere differentiable.

Proof
Let $C\left[{{0}\,.\,.\,{1}}\right]$ denote the set of all continuous functions $f: \left[{{0}\,.\,.\,{1}}\right] \to \R$.

By Continuous Functions on Closed Interval are Complete, $C\left[{{0}\,.\,.\,{1}}\right]$ is a complete metric space.

Let $X$ consist of the $f \in C\left[{{0}\,.\,.\,{1}}\right]$ such that:
 * $f\left({0}\right) = 0$;
 * $f\left({1}\right) = 1$;
 * for any $0 \le x \le 1$, we have $0 \le f\left({x}\right) \le 1$.

Lemma
$X$, defined as above, is a complete metric space.

Proof of Lemma
For every $f \in X$ define $\hat f : \left[{{0}\,.\,.\,{1}}\right] \to \R$ as follows:
 * $\hat f\left({x}\right) = \begin{cases}

\frac {3} {4} f\left({3x}\right) & \text{if } 0 \le x \le \frac {1} {3}\\ \frac {1} {4} + \frac {1} {2} f\left({2-3x}\right) & \text{if } \frac {1} {3} \le x \le \frac {2} {3}\\ \frac {1} {4} + \frac {3} {4} f\left({3x-2}\right) & \text{if } \frac {2} {3} \le x \le 1 \end{cases} $ Note that $\hat f \in X$ for all $f \in X$.

Furthermore, $\hat \cdot: X \to X$ is a contraction mapping, as we have the following:
 * $\forall f \in X: \left\|{\hat f}\right\|_\infty \le \frac {3} {4} \left\|{f}\right\|_\infty$

The Contraction Mapping Theorem assures existence of an $h \in X$ with $\hat h = h$.

This $h$ is a continuous function (as $h \in X$), and we will show that it is nowhere differentiable.

For any $n \in \N$ and $k \in \left\{{1, 2, 3,\ldots, 3^n}\right\}$, we have the following:
 * $1 \le k \le 3^n \implies 0 \le \frac{k-1} {3^{n+1}} < \frac {k} {3^{n+1}} \le \frac {1} {3}$.
 * $3^n < k \le 2 \cdot 3^n \implies \frac {1} {3} \le \frac {k-1} {3^{n+1}} < \frac {k} {3^{n+1}} \le \frac {2} {3}$
 * $2 \cdot 3^n < k \le 3^{n+1} \implies \frac {2} {3} \le \frac {k-1} {3^{n+1}} < \frac {k} {3^{n+1}} \le 1$

Using the above, prove by induction that
 * $\forall n \in \N: \forall k \in \left\{{1, 2, 3, 4, \ldots, 3^n}\right\}: \left|h\left({ \frac {k-1} {3^n} }\right) - h\left({ \frac {k} {3^n} }\right)\right| \ge 2^{-n}$

Take any A, 0<=A<=1. We will show that h is not differentiable at A.

Let's construct a sequence t[n] approaching A. Take any n:-N. We can choose k:-{1,2,3,4,...,3^n} such that (k-1) * 3^(-n) <= a <= k * 3^(-n).

By the triangle inequality, we have

>= |h( (k-1) / 3^n ) - h( k / 3^n )| >= 2^(-n)
 * h( (k-1) / 3^n ) - h(A)| + |h(A) - h( k / 3^n )|

Let t[n] be equal to (k-1)/3^n or to k/3^n so that the following condition is fulfilled:


 * h(t[n]) - h(A)| = max{ |h( (k-1) / 3^n ) - h(A)|, |h(A) - h( k / 3^n )| }.

Now we have t[n] != A and 2*|h(t[n]) - h(A)| >= 2^(-n). Also |t[n]-A| <= 3^(-n).

We constructed {t[n]} contained in [0,1] converging to A, never equal to A.

Notice that for every n:-N we have


 * h(t[n]) - h(A)| /  |t[n] - A|  >=  1/2 * (3/2)^n.

Hence lim |h(t[n]) - h(A)| /  |t[n] - A| = oo as n approaches oo.

This means that h is not differentiable at A.

The proof is complete.