Why exactly does a function need to be continuous on a closed interval for the intermediate value theorem to apply? I apologize if this question is too basic. The intermediate value theorem states that if $f$ is continuous on a closed interval $[a,b]$, then for every value $c$ between $f(a)$ and $f(b)$ there exists some $x \in (a,b)$ such that $f(x) = c$. This, or some very similar variant thereof, is how the intermediate value is usually presented in textbooks. What bugs me, however, is the condition that $f$ need be continuous on the closed interval $[a,b]$ rather than the less strict condition of only being continuous on the open interval $(a,b)$. To illustrate this point, consider $f:[-1,1] \rightarrow \mathbb{R}$ where $f(x)= e^x$. This is only continuous on the open interval $(-1,1)$ but surely the IVT applies to it. A less artificial example would be the inverse sine function. Would this reasoning not apply to all such (continuous/well-behaved) functions?
As an alternative, wouldn't the following definition from Proofwiki be superior (in that it is slightly more general)? 
Let $I$ be a real interval. Let $a,b \in I$ such that $(a,b)$ is an open interval. Let $f:I \rightarrow \mathbb{R}$ be a real function continuous in $(a,b)$. Then for every value $c \in \mathbb{R}$ between $f(a)$ and $f(b)$ there exists some $x \in (a,b)$ such that $f(x) = c$
 A: I think what you are trying to say is that requiring continuous on closed interval is a bit too much. But at least for the time being note that (classic) IVT does not even make sense if $f(a),f(b)$ is not defined.
The essence of IVT is the fact that the notion of connectedness is preserved under continuous mapping. Consider for example the fucntion
$$
f(x)=1/x \;\; \forall x\in(0,1)
$$
Classic IVT cannot possibly be applied here since $f(0)$ is not even defined. But it is still true that, for every $c\in (1,\infty)$ we can find some $x_0\in (0,1)$ such that $f(x_0)=c$.
This is because $f$ is continuous, and that $(0,1)$ is connected, so that $f((0,1))$ is necessarily connected.
A: I think 5xum's answer gives a good example. The general reason you need continuity on a closed interval is that you need to tie the values $f(a)$ and $f(b)$ to the values the function takes on the rest of the interval. If the function is not continuous at the end points then its value at the endpoints need have nothing to do with the values the function takes on the interior of the interval.
If you did want to change the IVT to work for an open interval you could use the following modification.
Let $f(x)$ be continuous on an open interval $(a,b)$ and let $c,d\in (a,b)$ such that $f(c)<f(d)$, then $\forall e\; (f(c)<e<f(d))$ there exists a $g\in (a,b)$ such that $f(g)=e$. 
A: The function
$$f(x) = \begin{cases}10 & x = -1\\ 0 & x\in (-1,1) \\ 20 & x=1\end{cases}$$ does not satisfy the IVT. There is no $x\in(-1,1)$ such that $f(x)$ is between $f(-1)$ and $f(1)$.
However, clearly $f$ is continuous on $(-1,1)$.
