Is it true that if the derivative of a function is not continuous then the function is not differentiable?

The derivative $f'(x)$ of a differentiable function, $f(x)$, need not be continuous itself. A classical example is the function

$$f(x)=\begin{cases}x^2\sin(1/x)&,x\ne0\\\\0&,x=0\end{cases}$$

Then, we have

$$f'(x)=\begin{cases}2x\sin(1/x)-\cos(1/x)&,x\ne0\\\\0&,x=0\end{cases}$$

Clearly, $\lim_{x\to 0}f'(x)$ does not even exist while $f'(0)=0$ as shown by

$$f'(0)=\lim_{h\to 0}\frac{h^2\sin(1/h)-0}{h}=0$$

Hence, we have an example of a function that is differentiable at $x=0$ although it derivative is discontinuous at $x=0$.


Another counterexample, which has the additional property $\limsup\limits_{x\to 0^+} f'(x)=\infty$ and $\liminf\limits_{x\to 0^+} f'(x)=-\infty$ is $$f(x):=x^2\left( \sin\frac1x\right)\ln\lvert x\rvert$$ whose derivative (basically the same reason as DR.MV's answer) is $$f'(x)=\begin{cases}2x\left( \sin\frac1x\right)\ln\lvert x\rvert-\color{blue}{\left(\cos\frac1x\right)\ln\lvert x\rvert}+x\sin\frac1x&\text{if }x\ne0\\ 0&\text{if }x=0\end{cases}$$

However, there are restrictions on how a derivative can be discontinuous at a given point. For instance, an interesting question for the sake of your problem is:

Let $f$ be a differentiable function $[0,\varepsilon)\to \Bbb R$. Can $\lim\limits_{x\to0^+} f'(x)=\infty$ hold?

The answer is no: in fact, assume as a contradiction that this were the case. Then, by extending $f$ to $$\overline f(x):=\begin{cases} f(x)&\text{if }x\in[0,\varepsilon)\\ f'(0)x+f(0)&\text{if }x<0\end{cases}$$

we can assume that $f$ is a differentiable function on $(-\infty,\varepsilon)\ni 0$ with constant derivative for $x\le0$.

Now, due to Darboux's theorem, the image under $f'$ of any interval $(-\delta,\delta)$ must be an interval $I$ containing $f'(0)$. But this cannot be the case, because, since $\lim\limits_{x\to 0^+}f'(x)=\infty$, $\{f'(0)\}\subsetneqq f'(-\delta,\delta)\subseteqq \{f'(0)\}\cup [f'(0)+1,\infty)$ for $\delta$ sufficiently small. Absurd.

With the same idea, you can also prove that the derivative of a function, though it can be discontinuous, it cannot have jump discontinuities.

Added: To spill the beans, at each point $x$ it must hold $$\liminf_{t\to x^+} f'(t)\le f'(x) \le \limsup_{t\to x^+}f'(t)\\ \liminf_{t\to x^-} f'(t)\le f'(x) \le \limsup_{t\to x^-}f'(t)$$


Just to add a thought to what others already said.

As Dr MV pointed out, a function is differentiable at a point if the limit of the difference quotient exists and is finite. That's it. Continuity of the derivative is something more. Therefore your answer was correct.

However, continuity is required when we say that a function $f$ is in $\mathcal{C}^1(I)$ (here $I$ is an interval): $f$ is in $\mathcal{C}^1(I)$ if it is differentiable in $I$, and the derivative is also continuous in $I$.

In this context, the example given by Dr MV is an example of a function which is differentiable everywhere, but does not belong to $\mathcal{C}^1(\mathbb{R})$.