An Example of a Continuous Nowhere Differentiable Function

We would like to sum out to infinity, which we cannot do:

u[x_]=Sum[(((1/2))^k)Sin[(5^k)π x],{k,0,Infinity}]

This plot shows how increasing n increases the jaggedness of the curve (even at n=10 is is pretty jagged!).

Clear[p1]
Do[
p1[n]=Plot[u[x,n],{x,4.8,5.0}]
,{n,1,10,1}]

Manipulate[Show[p1[n]],{n,1,10,1}]

So, let's truncate the sum at some large value of n so we can at least get an idea of what is going on (takes awhile for large n).

u[x_,n_]=Sum[(((1/2))^k)Sin[(5^k)π x],{k,0,n}]
f[x_]=u[x,400];

Plot[f[x],{x,-5,5}]

The point is (HA!) that this function is continuous, but nowhere differentiable--if we zoom in it still looks jaggedy (and would look more like the original if we took larger n).

Plot[f[x],{x,4.9999,5.0001}]

Here's a plot that zooms in, and the fractal nature is apparent. It looks for n=10 that we are losing some of the jaggedness, but remember we are approximating an infinite sum so if we included more terms it would still look as jagged as the original.

Clear[p2]
Do[
p2[j]=Plot[f[x],{x,4.8*(10^(-j)),5.0*(10^(-j))}]
,{j,1,10,1}]

Manipulate[Show[p2[j]],{j,1,10,1}]