Is the composition of two nowhere differentiable functions still nowhere differentiable?

The composition may have points of differentiability.

Let $f_0(x)=x$ for $x\geq 0$ and $f_0(x)=2x$ for $x<0$. Let $g_0(x)=2x$ for $x\geq 0$ and $g_0(x)=x$ for $x<0$. Then none of them is differentiable at $0$, but $f_0\circ g_0=2x$ is differentiable everywhere.

Let $h$ be a function that is nowhere differenitable, except at $0$ where it is very rapidly decaying. E. g. I can take $h(x)=e^{-\frac{1}{x^2}}B_{|x|}$, where $B_t$ is a sample of Brownian motion.

Now just take $f=f_0+h$ and $g=g_0+h$.


The composition can be differentiable.

Example: Let $f(x):=1$ for rational $x$ and $f(x):=0$ for irrational $x$. Then $f$ is nowhere differentiable. Let $g:=f$. Then $f\circ g(x)=1$ for all $x$, thus $f\circ g$ is differentiable everywhere.