Solution (source code)

= Solution

The zeros of $\cos(\pi/x)$ occur at
$$
x_k=\frac{2}{2k+1},\qquad k\in\mathbb Z.
$$
Let $g(x)=\cos(\pi/x)$. At these nonzero points,
$$
g(x_k)=0,\qquad
 g'(x_k)=\frac\pi{x_k^2}\sin\frac\pi{x_k}
=\frac{\pi(-1)^k}{x_k^2}\ne0.
$$
The definition of the <derivative> gives $g(x_k+h)=g'(x_k)h+o(|h|)$, hence
$$
|g(x_k+h)|=\frac\pi{x_k^2}|h|+o(|h|).
$$
The <sign function> is constant sufficiently near the nonzero point $x_k$, and $(x_k+h)^2=x_k^2+O(h)$. As $f(x_k)=0$, multiplication yields
$$
f(x_k+h)=\pi\operatorname{sign}(x_k)|h|+o(|h|).
$$
Its right and left <one-sided derivatives> are therefore $\pi\operatorname{sign}(x_k)$ and $-\pi\operatorname{sign}(x_k)$ respectively. They differ, so $f$ is not differentiable at any $x_k$. In particular, $x_k\to0$ as $k\to+\infty$, proving
$$
\boxed{\text{Every neighbourhood of }0\text{ contains points where }f'\text{ does not exist}.}
$$
The <absolute value at a simple zero> mechanism creates unequal <one-sided derivatives>. It also shows why the existence of $f'(0)$ alone does not imply <higher-order differentiability at a point> of order two.