TITLE: Other example of non continuous derivative
QUESTION [5 upvotes]: I was trying to build an example of a function that is differentiable at $0$, and around $0$. But the derivative is not continuous at $0$
A family of functions that work is: (thank you Andrew D. Hwang for the general form)
$$
f(x) = \left\{
    \begin{array}{ll}
        x^{1+\epsilon}\psi(x^{-\alpha}))  & \mbox{if } x\ne0 \\
        0 & \mbox{if x=0}
    \end{array}
\right.
$$
With $\psi$ a periodic and bounded function (or a modified trig function) and $\alpha>0,\epsilon>0$
Is there an example that does not belong to this family of functions? (I have found such examples, but I am not satisfied with them because of how I built them (they are not deeply different), so I'm still interested to get ideas!)

REPLY [2 votes]: Suppose $f$ is differentiable on an open interval about $0$, and that $f'$ is discontinuous at $0$ (but continuous elsewhere, in the interest of delimiting the structure of "the simplest examples").
Consider the "lower" and "upper" limits of $f'$ at $0$:
$$
L_{-} = \lim_{\delta \to 0^{+}} \inf_{0 < |x| < \delta} f'(x),\qquad
L_{+} = \lim_{\delta \to 0^{+}} \sup_{0 < |x| < \delta} f'(x).
$$
By Darboux's theorem, $\lim(f', 0)$ does not exist, so $L_{-} < L_{+}$ (strict inequality), and the interval $(L_{-}, L_{+})$ is "hit by" $f'$ infinitely many times in each neighborhood of $0$.
Qualitatively, $f'$ oscillates infinitely many times (between $L_{-}$ and $L_{+}$) in every neighborhood of $0$.
This doesn't mean that every such $f$ has the form $f(x) = x^{1 + \varepsilon} \psi(x^{-\alpha})$ with $\psi$ periodic, but does indicate why common counterexamples have this form.