# necessary condition for the mean value theorem

Give an example which demonstrates that continuity is a necessary condition for the mean value theorem:

I thought in this function:

$$g(x) = \begin{cases} x + 1 & x < 1 \\[4pt] x - 1 & 1 \leq x\\ \end{cases}$$

Clearly $g(x)$ is not continuos in $1$, i try to find the derivative of this function but i stuck some help please for prove that for this function can't use the mean value theorem.

• Pleae reread the statement of the mean value theorem. Especially, for interior points it demands much more than continuity! You can use your $g$ if yuo pick the intervall $[a,b]$ appropriately though) Commented May 16, 2014 at 19:30

Consider your function $g$ on the interval $[0,1]$. Then $g$ is indeed differentiable in $(0,1)$ (with $g'(x)=1$ for all $x\in(0,1)$. The claim of the mean value theorem would say that there exists $c\in(0,1)$ with $g'(c)=\frac{g(1)-g(0)}{1-0}$, i.e. $1=-1$.
For your function, $g(0)=g(2)=1$ so if the mean value theorem applied there would be a point beteen 0 and 2 where the derivative was 0. But the derivative is equal to 1 with left and right limits both equal to 1 at $x=1$. Hence the mean value theorem fails for this discontinuous function.
• On $[0,2]$, the function not only fails to be continuous on $[0,2]$, it also fails to be differentiable on $(0,2)$; so this is not a perfect example Commented May 16, 2014 at 19:34