Image of Interval by Continuous Function is Interval

Theorem
Let $f$ be a real function which is continuous on an interval $I$.

Then the image of $I$ by $f$ is also an interval.

Proof
Let $J = f \left({I}\right) = \left\{{f \left({x}\right): x \in I}\right\}$.

From the property defining an interval, we need to show that if $J$ is an interval, then $y_1, y_2 \in J, y_1 \le \lambda \le y_2 \implies \lambda \in J$.

So suppose $y_1, y_2 \in J$, and suppose $y_1 \le \lambda \le y_2$.

Consider these subsets of $I$:
 * $S = \left\{{x: f \left({x}\right) \le \lambda}\right\}$
 * $T = \left\{{x: f \left({x}\right) \ge \lambda}\right\}$

As $y_1 \le \lambda \in J$ and $y_2 \ge \lambda \in J$, it follows that $S$ and $T$ are both non-empty.

Also, every point of $I$ belongs to either $S$ or $T$.

So from Interval Divided into Subsets, a point in one subset is at zero distance from the other.

So, suppose that $s \in S$ is at zero distance from $T$.

From Limit of Sequence to Zero Distance Point, we can find a sequence $\left \langle {t_n} \right \rangle$ in $T$ such that $\displaystyle \lim_{n \to \infty} t_n = s$.

Since $f$ is continuous on $I$, it follows from Limit of Image of Sequence that $\displaystyle \lim_{n \to \infty} f \left({t_n}\right) = f \left({s}\right)$.

But $\forall n \in \N^*: f \left({t_n}\right) \ge \lambda$.

Therefore by Lower and Upper Bounds for Sequences, $f \left({s}\right) \ge \lambda$.

We already have that $f \left({s}\right) \le \lambda$.

Therefore $f \left({s}\right) = \lambda$ and so $\lambda \in J$.

A similar argument applies if a point of $T$ is at zero distance from $S$.