# Question on Mc Carthy's nowhere differentiable function

Mc Carthy's function is a simple example of a nowhere differentiable but everwhere continuous function. Its construction here contains very little detail and I have some questions (highlighted in bold). I also add some more details

Consider $g:\mathbb{R}\to \mathbb{R}$ with $$g(x)=\begin{cases}1+x&\text{ if, }x\in [-2,0]\\ 1-x&\text{ if, }x\in (0,2]\end{cases}$$ and then extended periodically with $g(x+4)=g(x)$. The Mc Carthy function is $$f(x)=\sum_{k=1}^{\infty}2^{-k}g(2^{2^k}x)$$ Consider the sequence $h_n=\pm 2^{-2^n}$ where the sign is chosen so that $x$ and $x+h_n$ are in the same linear segment of $g(2^{2^n}t)$. Can this be done as the period of $g(2^{2^n}t))$ is $4\cdot 2^{-2^n}=2\left|h_n\right|$ ?.

For $k\in \mathbb{N}$ observe that $k>n$ implies $2^{2^k}h_n$ is a multiple of $4$ and so letting $f_k=g(2^{2^k})$ we have $$f_k(x+h_n)-f_k(x)=g(2^{2^k}x+2^{2^k}h_n)-g(2^{2^k}x)=0$$ If $k=n$ then, $$\left|f_n(x+h_n)-f_n(x)\right|=\left|g(1+2^{2^k}x)-g(2^{2^k}x)\right|=1$$ If $k<n$ then $x,x+h_n$ lie in the same segment of $f_k$ (as $f_k$ has a bigger period to $f_n$?) as well meaning $$\left|f_k(x+h_n)-f_k(x)\right|\le 2^{2^k}\left|x+h_n-x\right|=2^{2^k-2^n}$$ and so $$\max_{k=1,...,n-1}\left|f_k(x+h_n)-f_k(x)\right|\le 2^{-2^{n-1}}\implies \sum_{k=1}^{n-1}2^{-k}\left|f_k(x+h_n)-f_k(x)\right|\le 2^{-2^{n-1}}\sum_{k=1}^{n-1}2^{-k}<2^{-2^{n-1}}$$ We conclude that \begin{gather}\left|\frac{f(x+h_n)-f(x)}{h_n}\right|=2^{2^n}\left|\sum_{k=1}^{\infty}2^{-k}[f_k(x+h_n)-f_k(x)]\right|=2^{2^n}\left|\sum_{k=1}^n2^{-k}[f_k(x+h_n)-f_k(x)]\right|\ge\\ \ge 2^{2^n}-2^{2^n}\left|\sum_{k=1}^{n-1}2^{-k}[f_k(x+h_n)-f_k(x)]\right|> 2^{2^n}-2^{2^n}2^{-2^{n-1}}=2^{2^n}-2^{-2^{n-1}}\to +\infty \end{gather} Mc Carthy however has a weaker bound. Is there a problem in my deductions? Also why does he show $$\left|\sum_{k=1}^{n-1}f_k(x+h_n)-f_k(x)\right|<2^n2^{-2^{n-1}}?$$ How is this sum needed?

-