[Math] Why exactly does a function need to be continuous on a closed interval for the intermediate value theorem to apply

calculusreal-analysis

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$

Best Answer

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)$.

Related Question