TITLE: Does $f~'$ have to be continuous for application of Mean Value Theorem?
QUESTION [6 upvotes]: If $f$ is a continuous function in $[a,b]$, then for any $x,y \in [a,b];~y>x$, we say that $\exists~c \in [x,y]$ such that $f~'(c)= \dfrac {f(y)-f(x)}{y-x}$.
Does $f~'$ have to be necessarily continuous to apply the mean value theorem for derivatives?
If not, why is $f~''$ needed to be continuous in this problem here
Thank you very much for your help.

REPLY [3 votes]: No,  it is necessary that $f$ be continuous on $[a,b]$ and that $f^{\prime}$  merely exists everywhere on $(a,b)$. The Mean Value Theorem is an easy consequence of Rolle's Theorem, so I discuss the proof of Rolle's Theorem. So assume that $f(a) = f(b)$, and it suffices to prove that $f^{\prime}(c) = 0$ for some $c \in (a,b).$
  The essential point is that by the continuity of $f$, with no assumption on $f^{\prime}$, but using the fact that we are dealing with a closed interval, there is some $c \in [a,b]$ such that $f(x) \leq f(c)$ for all $x \in [a,b].$ If $c = a$ or $c = b,$ then $f$ is constant on $[a,b]$ and $f^{\prime} = 0$ everywhere on $(a,b)$. Suppose then that $c \in (a,b)$. Now if $x < c$ then $f(x) - f(c) \leq 0$ and $\frac{f(x)-f(c)}{x-c} \geq 0$ and hence $\lim_{x \to c^{-}}\frac{f(x)-f(c)}{x-c} \geq 0 .$ Similarly, if $x > c$ then $f(x) - f(c) \leq 0$ and $\frac{f(x)-f(c)}{x-c} \leq 0$ and hence $\lim_{x \to c^{+}}\frac{f(x)-f(c)}{x-c} \leq 0 .$ But since $f$ is differentiable at $c$, these two limits must be equal. Since one is $\geq 0$ and the other is $\leq 0$, they must both be $0,$ and $f^{\prime}(c) = 0.$