$\begingroup$

This question already has answers here: Why does the Mean Value Theorem require a closed interval for continuity and an open interval for differentiability? (2 answers) Closed last year .

For mean value theorems like Lagrange's and Rolle's, we have the following conditions:

For applying mean value theorem to any function $f(x)$ for the domain $[a,b]$ , it should be (1) continuous in $[a,b]$ (2) differentiable in $(a,b)$

So why is it that for the criteria of differentiablity, we have the open interval ?? Is it possible for a function differentiable in $(a,b)$ and continuous in $[a,b]$ to be non- differentiable at the end points?

Also why is the first statement needed ?? Doesn't the second statement of differentiablity also mean that the function is continuous ?? I'm not very experienced in calculus and still in high-school, so it might be something too obvious I'm missing , please help :)