[proofplan]
We prove the Intermediate Value Theorem using the completeness of $\mathbb{R}$. Define the set $S = \{x \in [a,b] : f(x) < \lambda\}$, take $c = \sup S$, and show $f(c) = \lambda$ by proving both $f(c) \leq \lambda$ and $f(c) \geq \lambda$ using continuity and the properties of the supremum.
[/proofplan]
[step:Define the supremum of the sub-level set $S = \{x \in [a,b] : f(x) < \lambda\}$]
Define $S = \{x \in [a,b] : f(x) < \lambda\}$. Since $f(a) < \lambda$, we have $a \in S$, so $S \neq \varnothing$. Since $S \subseteq [a,b]$, the set $S$ is bounded above by $b$. By the completeness of $\mathbb{R}$, the supremum $c = \sup S$ exists and satisfies $a \leq c \leq b$.
[/step]
[step:Show $f(c) \leq \lambda$ by approaching $c$ from below]
By the definition of supremum, for each $n \in \mathbb{N}$ there exists $x_n \in S$ with $c - 1/n < x_n \leq c$. Then $x_n \to c$ and $f(x_n) < \lambda$ for all $n$. Since $f$ is continuous and $x_n \to c$ with $c \in [a,b]$, we have $f(x_n) \to f(c)$. The [upper bound preservation property of limits](/theorems/170) (part (vii)) applied to $f(x_n) \leq \lambda$ gives
\begin{align*}
f(c) \leq \lambda.
\end{align*}
[guided]
The supremum $c$ is the boundary between points where $f < \lambda$ and points where $f \geq \lambda$. To show $f(c) \leq \lambda$, we approximate $c$ from below by elements of $S$.
For each $n$, the definition of supremum guarantees the existence of $x_n \in S$ with $c - 1/n < x_n \leq c$. These points satisfy $f(x_n) < \lambda$ (since $x_n \in S$) and $x_n \to c$ (since $|x_n - c| < 1/n$). Continuity of $f$ gives $f(x_n) \to f(c)$, and since $f(x_n) < \lambda \leq \lambda$ for all $n$, the limit satisfies $f(c) \leq \lambda$ by the [upper bound preservation property](/theorems/170).
[/guided]
[/step]
[step:Show $f(c) \geq \lambda$ by approaching $c$ from above, and conclude $c \in (a,b)$]
We first note $c < b$: if $c = b$, then $f(c) = f(b) > \lambda$, contradicting $f(c) \leq \lambda$ from the previous step. So $c < b$.
For each $n$ sufficiently large that $c + 1/n \leq b$, the point $c + 1/n > c = \sup S$, so $c + 1/n \notin S$, meaning $f(c + 1/n) \geq \lambda$. Since $c + 1/n \to c$ and $f$ is continuous, $f(c + 1/n) \to f(c)$. The [lower bound preservation property of limits](/theorems/170) (part (viii)) applied to $f(c + 1/n) \geq \lambda$ gives
\begin{align*}
f(c) \geq \lambda.
\end{align*}
[/step]
[step:Combine the inequalities to conclude $f(c) = \lambda$ with $c \in (a,b)$]
From the previous two steps, $f(c) \leq \lambda$ and $f(c) \geq \lambda$, so $f(c) = \lambda$. Since $f(a) < \lambda = f(c)$, we have $c \neq a$, and since $c < b$, we conclude $c \in (a,b)$.
[/step]