What is the difference between differentiability of a function and continuity of its derivative?

I am sort of confused regarding differentiable functions, continuous derivatives, and continuous functions. And I just want to make sure I'm thinking about this correctly.

(1) If you have a function that's continuous everywhere, then this doesn't necessarily mean its derivative exists everywhere, correct? e.g., $$f(x) = |x|$$ has an undefined derivative at $x=0$

(2) So this above function, even though its continuous, does not have a continuous derivative?

(3) Now say you have a derivative that's continuous everywhere, then this doesn't necessarily mean the underlying function is continuous everywhere, correct? For example, consider $$ f(x) = \begin{cases} 1 - x \ \ \ \ \ x<0 \\ 2 - x \ \ \ \ \ x \geq 0 \end{cases} $$ So its derivative is -1 everywhere, hence continuous, but the function itself is not continuous?

So what does a function with a continuous derivative say about the underlying function?


A function may or may not be continuous.

If it is continuous, it may or may not be differentiable. $f(x) = |x|$ is a standard example of a function which is continuous, but not (everywhere) differentiable. However, any differentiable function is necessarily continuous.

If a function is differentiable, its derivative may or may not be continuous. This is a bit more subtle, and the standard example of a differentiable function with discontinuous derivative is a bit more complicated: $$ f(x) = \cases{x^2\sin(1/x) & if $x\neq 0$\\ 0 & if $x = 0$} $$ It is differentiable everywhere, $f'(0) = 0$, but $f'(x)$ oscillates wildly between (a little less than) $-1$ and (a little more than) $1$ as $x$ comes closer and closer to $0$, so it isn't continuous.


  1. Indeed.
  2. Indeed, the derivative does not even exist at $x=0$ as you argued in (1).
  3. Continuity is a necessary condition for differentiability (but it is not sufficient, as you have found in (1)). Your example is not differentiable at $0$, since it is discontinuous there. In particular, you can see this directly since $$ \lim_{h\to0^+} \frac{f(h)-f(0)}{h} = \lim_{h\to0^+} \frac{(2-h)-2}{h} = -1, $$ whereas $$\lim_{h\to0^-} \frac{f(h)-f(0)}{h} = \lim_{h\to0^-} \frac{(1-h)-2}{h} = \lim_{h\to0^-} \frac{-1-h}{h}$$ does not even exist.

As you have shown the continuity of the derivative function doesn't guarantee that the function is itself continuous since it can be piecewise continuous.

WHat we can show is Continuous differentiability implies Lipschitz continuity.