TITLE: Difficulties in stating mean value theorem for functions which are not continuous on a closed interval.
QUESTION [12 upvotes]: The mean value theorem is stated as follows

Let there be a function $f$ which is continuous on $[a,b]$ and differentiable on $(a,b)$. Then there exists $c$ belonging to $(a,b)$ such that $f′(c)=\frac{f(b)−f(a)}{b−a}$.

Now, here it is assumed that the function is continuous on a closed interval. What I don't understand is the use of making the function continuous on a closed interval. I understand that then $f(a)$ and $f(b)$ will not be defined if we use rather an open interval (a,b), but then we can take into account the limits as x approaches a and b of the function (sometimes one-sided limits) instead of the values of the function at $a$ and $b$.
I know this would be tedious and would make the theorem complicated, but what I want to ask is that whether there is any other reason for proposing a closed continuous function rather than an open or half-open one.

REPLY [4 votes]: If $f$ is not continuous at the endpoints, then how could knowing the values at the endpoints possibly tell you anything about its behavior elsewhere? Suppose we have the function $f: x \to x^2$ on the interval $(0,1)$. If $f$ is continuous, then $f(0) = 0$, $f(1) = 1$, so the MVT says that there is some place where the derivative of $f$ is $\frac{1-0}{1-0} = 1$. And indeed, $f'(0.5) = 1$. But if $f$ is not continuous, then $f(0)$ and $f(1)$ could be anything. For instance, $f(0)$ could be $-100$ and $f(1)$ could be $100$. Then the MVT would require there be a point in the interval such that the derivative is $200$, which clearly is not the case. 
Yes, you could take the limit at $f(a)$ instead of $f(a)$, but then you have to worry about whether that limit exists, and if it does exist, then you're basically creating a new function with the value at a replaced by the limit at $a$. So why have a theorem that says "Given any function $f_1$, if $f_1$ can be turned into a continuous function $f_2$, then this holds for $f_2$", when you can just say " This holds for a continuous function"?