TITLE: Is there a function $f''(0)$ exists, $f'$ is not continuous on $(-\delta,\delta)$
QUESTION [5 upvotes]: Is  there a function $f\colon(-\delta,\delta)\to\Bbb R$ satisfying the folowing conditions(real number $ \delta\gt0$)? 
(i) $f$ is  differentiable on $(-\delta,\delta)$;
(ii) the second derivative of $f$ exists  at $0$, that is $f''(0)$ exists
(iii) there is a sequence $\{x_n\}$, $-\delta\lt x_n\lt \delta$, $\lim\limits_{n\to\infty}x_n=0$,  such that $f'$ is not continuous  at all $x_n$.

I can't construct such  a  example
Any help will be appreciated!

REPLY [8 votes]: The standard way to get a function that is differentiable everywhere (with bounded derivative) but whose derivative has a discontinuity point is
$$ g(x) = \begin{cases} 0 & x=0 \\ x^2\sin(1/x) & x\ne 0 \end{cases} $$
Now select your $x_n$s and define
$$ f(x) = x^2 \sum_{k=1}^\infty \frac{g(x-x_k)}{2^k} $$
This places a discontinuity of $f'$ at each $x_k$, and the overall factor of $x^2$ squeezes the range of $f'$ around $0$ enough to make sure $f''(0)$ exists.