[proofplan]
We argue by contradiction. If no positive uniform bound exists for $|f|$ on $[a,b]$, then for each natural number $n$ we can choose a point $x_n \in [a,b]$ with $|f(x_n)| > n$. The interval bounds allow us to extract a convergent [subsequence](/pages/1149), and [continuity](/pages/1199) forces the corresponding function values to converge, contradicting their growth beyond every index.
[/proofplan]
[step:Choose points whose function values exceed every natural number]
Suppose, toward a contradiction, that the conclusion is false. Then there is no $M > 0$ such that $|f(x)| \leq M$ for all $x \in [a,b]$. Therefore, for each $n \in \mathbb{N}$, applying this failure with $M = n$, there exists a point $x_n \in [a,b]$ such that
\begin{align*}
|f(x_n)| > n.
\end{align*}
This defines a sequence $(x_n)_{n=1}^{\infty}$ in $[a,b]$.
[/step]
[step:Extract a subsequence converging to a point of the interval]
Since $x_n \in [a,b]$ for every $n \in \mathbb{N}$, the sequence $(x_n)_{n=1}^{\infty}$ is bounded in $\mathbb{R}$. By the [Bolzano-Weierstrass Theorem](/theorems/171), there exist a strictly increasing sequence of indices $(n_j)_{j=1}^{\infty}$ in $\mathbb{N}$ and a point $c \in \mathbb{R}$ such that
\begin{align*}
x_{n_j} \to c
\end{align*}
as $j \to \infty$. Because $a \leq x_{n_j} \leq b$ for every $j \in \mathbb{N}$, the order-preserving property of limits gives $a \leq c \leq b$. Hence $c \in [a,b]$.
[guided]
The purpose of this step is to turn the sequence of bad points into a sequence with a limit point where continuity can be used. For every $n \in \mathbb{N}$, we already know $x_n \in [a,b]$, so
\begin{align*}
a \leq x_n \leq b.
\end{align*}
Thus $(x_n)_{n=1}^{\infty}$ is bounded in $\mathbb{R}$. The [Bolzano-Weierstrass Theorem](/theorems/628) applies to bounded real sequences, so there exist a strictly increasing sequence of indices $(n_j)_{j=1}^{\infty}$ and a real number $c \in \mathbb{R}$ such that
\begin{align*}
x_{n_j} \to c
\end{align*}
as $j \to \infty$.
We still need the limit point to lie in the domain of $f$. Since $x_{n_j} \in [a,b]$ for every $j$, we have
\begin{align*}
a \leq x_{n_j} \leq b
\end{align*}
for every $j \in \mathbb{N}$. Passing to the limit in both inequalities gives
\begin{align*}
a \leq c \leq b.
\end{align*}
Therefore $c \in [a,b]$, so continuity of $f$ at $c$ is available in the next step.
[/guided]
[/step]
[step:Use continuity to contradict the unbounded function values]
Since $f: [a,b] \to \mathbb{R}$ is continuous and $c \in [a,b]$, the [sequential characterisation of continuity](/theorems/179) applied to the sequence $(x_{n_j})_{j=1}^{\infty}$ gives
\begin{align*}
f(x_{n_j}) \to f(c)
\end{align*}
as $j \to \infty$. Every convergent real sequence is bounded, so there exists $B > 0$ such that
\begin{align*}
|f(x_{n_j})| \leq B
\end{align*}
for every $j \in \mathbb{N}$. But from the construction of $x_n$,
\begin{align*}
|f(x_{n_j})| > n_j.
\end{align*}
Because $(n_j)_{j=1}^{\infty}$ is strictly increasing in $\mathbb{N}$, we have $n_j \geq j$ for every $j \in \mathbb{N}$, hence
\begin{align*}
|f(x_{n_j})| > n_j \geq j.
\end{align*}
Choosing $j \in \mathbb{N}$ with $j > B$ contradicts $|f(x_{n_j})| \leq B$. Therefore the assumption was false, and there exists $M > 0$ such that
\begin{align*}
|f(x)| \leq M
\end{align*}
for all $x \in [a,b]$.
[/step]