What is wrong in this proof that any derivative function must be continuous? $f$ is differentiable on $(a, b)$. (1)
Let $\alpha \in (a, b)$.
$f'(\alpha) = \lim_{h \to 0}\frac{f(\alpha + h) - f(\alpha)}h$.
(1) $\implies f$ is differentiable between $\alpha$ and $\alpha + h$, inclusive.
By the mean value theorem, $\exists c_n$ between $\alpha$, $\alpha + h$: $f'(c_n) = \frac{f(\alpha + h) - f(\alpha)}{\alpha + h - \alpha}$.
So, $f'(\alpha) = \lim_{h \to 0}f'(c_n)$.
As $h \to 0$, $c_n \to \alpha$.
So, $f'(\alpha) = \lim_{c_n \to \alpha}f'(c_h) \implies f'$ is continuous at $\alpha \forall\alpha\in(a, b)$.
$\therefore f$ is differentiable on $(a, b) \implies f'$ is continuous on $(a, b)$.
But clearly the statement must not be true as for some functions like the following, the derivative exists, but is not continuous, at zero:
$f(n) =
\begin{cases}
n^2 \sin(\frac{1}{n^2})  & n \in \mathbb R \\
0 & n = 0.
\end{cases}$
$f'(0) = 0$. But $\lim_{n \to 0}f'(n)$ does not exist.
 A: Consider the assertion$$\displaystyle f'(\alpha)=\lim_{c_h\to\alpha}f'(c_h).\tag{1}$$There are several problems here:


*

*What does it even mean? You are acting as if $c_h$ is a well-determined number depending on $\alpha$ and $h$. It is not. All we know is that, for each $\alpha$ and each $h>0$, there is some $c_h$ with a certain property.

*Being continuous at $\alpha$ means that $\displaystyle\lim_{\beta\to\alpha}f'(\beta)=f'(\alpha)$, which is not what $(1)$ says.


As an example, consider the function$$\begin{array}{rccc}f\colon&\mathbb R&\longrightarrow&\mathbb R\\&x&\mapsto&\begin{cases}\sin\left(\frac1x\right)&\text{ if }x\neq0\\0&\text{ otherwise.}\end{cases}\end{array}$$It is not continuous at $0$. Now, for each $h>0$, let $c_h=\frac1{n\pi}$ where $n$ is the smallest natural number such that $\frac1{n\pi}<h$. Then it is clear that $f(c_h)=0$. Furthermore, $f(0)=0$. However, you can't deduce from this that $f$ is continuous at $0$.
A: Yes, $f'(c_h) \to f'(\alpha)$ as $h \to 0$ (sort of, it's not quite well defined, but you can find a sequence $h_n$ such that...), but that doesn't rule out the possibility that there is some other sequence $x_n \to \alpha$ such that $f'(x_n)$ does not tend to $f'(\alpha)$.
A: There was no problem with line 5. The mistake started at line 6 but not for the reason Jose Carlos Santos gave in their answer so their answer also incorrectly implies that there's a problem with line 5. Line 5 was fine because you defined for any α in the interval (a, b) and nonzero h such that α + h is in the interval (a, b) what cn is. Line 6 is perfectly well meaningful. The problem with line 6 is that for each α, you can only prove line 6 from line 5 under the assumption that $\lim_{h \to 0}f'(c_n)$ exists which can't be proven.
