I found this statement with the proof:
But I don't understand the proof. Where is the contradiction? We have a nonempty interval $J$ contained in the nonempty interval $(f(a),f(b))$. Where is the problem?
I found this statement with the proof:
But I don't understand the proof. Where is the contradiction? We have a nonempty interval $J$ contained in the nonempty interval $(f(a),f(b))$. Where is the problem?
On
This is essentially Paul Frost's answer, in a slighly less verbose form.
The range $f(I)$ contains the interval $(f(a),f(b))$, so every point in the interval $(f(a),f(b))$ is of the form $f(x)$ for some $x\in I$. On the other hand, only one endpoint of the non-empty interval $J$ is a value of $f$ - because $f$ jumps from $y_0^-$ to $y_0^+$. That is the contradiction.
On
There have been two answers, but the comments have shown that the arguments at first glance appeared a little obscure or cumbersome. I believe that everything is clarified now, either by enhancing the answers or by additional comments. But let us give another proof which is hopefully more transparent from the beginning.
Observe that in the theorem it is not specified whether $I$ is an open, closed or half-open interval and whether it is bounded or not. We shall prove the stronger result that $f$ is continuous on $I$.
Assume that $f$ is not continuous in a point $x_0 \in I$. Then $y_0^- < f(x_0)$ or $f(x_0) < y_0^+$. Note that only one of $y_0^\pm$ is defined if $x_0$ is a boundary point of $I$. We only consider the case $y_0^- < f(x_0)$, the other case is similar. The case under consideration can only occur when $I' = I \cap (-\infty,x_0) \ne \emptyset$. For $x < x_0$ we have $f(x) \le y_0^-$, for $x > x_0$ we have $f(x) \ge f(x_0)$. Therefore $(y_0^-,f(x_0) \cap f(I) = \emptyset$. For $\xi \in I'$ we have $f(\xi) \le y_0^-$ so that $(y_0^-,f(x_0) \subset [f(\xi),f(x_0)] \subset f(I)$ because $f(I)$ is an interval. This is the desired contradiction.
In the above form the proof isn't done well. You know that $y_0^- < f(x_0)$ or $f(x_0) < y_0^+$. Hence at least one of the intervals $J^- = (y_0^-, f(x_0))$ and $J^+ = (f(x_0),y_0^+)$ is non-empty and does not contain any point of the form $f(x)$. This comes from the fact that $f(x_0)$ is contained in none of these intervals and $f(x) \le y_0^-$ for $x < x_0$ and $f(x) \ge y_0^+$ for $x > x_0$. W.l.o.g. assume $J^- \ne \emptyset$ and $J^- \cap f(I) = \emptyset$.
This is a contradiction: By assumption $f(I)$ is an interval which must contain $J^-$ because $f(a) \le y_0^-$ and $y_0^+ \le f(b)$.