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 &amp; x &lt; 1 \\[4pt]
 x - 1 &amp; 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.
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$.
Mean value theorem in its usual formulation applies to differentiable functions. Which should be at least continuous. If a function is not continuous, then there is no tangent in some points (also, it would be strange to ask fo a derivative in jump point, since there g(x + Δx)- g(x) ↛ 0 as Δx→0)