Is a monotone differentiable function continuously differentiable?

Let $f(x)=x|x|(\sin(1/x))+2x|x|+2x$ for $x\ne 0.$ Let $f(0)=0.$ Then:

  • For $x > 0$, $f'(x)=2x \sin(1/x)-\cos(1/x)+4x+2=2x(\sin (1/x)+2)+2-\cos(1/x)$, which is positive for $x>0$.
  • For $x < 0$, $f'(x)=-2x \sin(1/x)+\cos(1/x)-4x+2 =-2x(\sin (1/x) + 2) + 2 + \cos(1/x)$, which is positive for $x<0$.
  • We can evaluate $f'(0)$ directly: $$f'(0)=\lim_{x \to 0} \frac{f(x)}{x}=\lim_{x \to 0} \left(|x|\sin (1/x) + 2|x| + 2\right)=2 \, . $$

So $f$ is everywhere differentiable with positive derivative; thus it is monotone. But $f'$ is discontinuous at $0$.


$g(x)=x^2\sin(1/x)$, $x\neq 0$, $g(0)=0$, is a function differentiable everywhere on $\mathbb R$ with discontinuous derivative at $0$. It isn't monotone yet.

Since $|g'(x)|\leq 2|x|+1$ for all $x$, we can add a function like $x^3+4x$ to make the derivative always positive, because $3x^2+4+g'(x)\geq 3x^2+4-|g'(x)|\geq 3x^2+4-2|x|-1\geq\begin{cases} 3x^2+1>0, & \text{if $|x|\leq1$ } \\ x^2+3>0, & \text{if $|x|\geq 1$} \\ \end{cases}.$

Thus $f(x) = x^2\sin(1/x)+x^3+4x$ is everywhere differentiable, increasing, with discontinuous derivative at $0$.


Alternatively, we could start with an example that has everywhere bounded derivative discontinuous at $0$, like $h(x)=e^{-x^2}x^2\sin(1/x)$, and then we only need to add a term $cx$, where $c>0$ is an upper bound for the absolute value of the derivative of $h$ ($c=2$ suffices I think).