Why do mean value theorems have open interval for differentiablity while closed for continuity?

Here are a couple of examples to think about:

  1. $f(x) = \sqrt{x}$ on the interval $[0,1]$. This is continuous on $[0,1]$ and differentiable on $(0,1)$, but not differentiable at 0 in any reasonable sense. Yet the mean value theorem applies to it.

  2. $f(x) = \begin{cases} 0, & x = 0 \\ 1, & x > 0. \end{cases}$ This is differentiable on $(0,1)$ but the mean value theorem does not apply to it.


For example, the function $\sqrt{x(1-x)}$ is continuous in $[0,1]$ but only differentiable on $(0,1)$.

On the other hand, $1/x$ is differentiable in $(0,\infty)$ but is not continuous at $0$ (even if you define it at $0$).