The lemma says that \(f\) is bounded, so the set \(f\bigl([a,b]\bigr) = \bigl\{ f(x) : x \in [a,b] \bigr\}\) has a supremum and an infimum. There exist sequences in the set \(f\bigl([a,b]\bigr)\) that approach its supremum and its infimum. That is, there are sequences \(\bigl\{ f(x_n) \bigr\}_{n=1}^\infty\) and \(\bigl\{ f(y_n)
\bigr\}_{n=1}^\infty\text{,}\) where \(x_n\) and \(y_n\) are in \([a,b]\text{,}\) such that
\begin{equation*}
\lim_{n\to\infty} f(x_n) = \inf f\bigl([a,b]\bigr) \qquad \text{and} \qquad
\lim_{n\to\infty} f(y_n) = \sup f\bigl([a,b]\bigr).
\end{equation*}
We are not done yet; we need to find where the minima and the maxima are. The problem is that the sequences
\(\{ x_n \}_{n=1}^\infty\) and
\(\{ y_n \}_{n=1}^\infty\) need not converge. We know
\(\{ x_n \}_{n=1}^\infty\) and
\(\{ y_n \}_{n=1}^\infty\) are bounded (their elements belong to a bounded interval
\([a,b]\)). Apply the
Bolzano–Weierstrass theorem to find convergent subsequences
\(\{ x_{n_i} \}_{i=1}^\infty\) and
\(\{ y_{m_i} \}_{i=1}^\infty\text{.}\) Let
\begin{equation*}
x \coloneqq \lim_{i\to\infty} x_{n_i}
\qquad \text{and} \qquad
y \coloneqq \lim_{i\to\infty} y_{m_i}.
\end{equation*}
As \(a \leq x_{n_i} \leq b\) for all \(i\text{,}\) we have \(a \leq x \leq b\text{.}\) Similarly, \(a \leq y \leq b\text{.}\) So \(x\) and \(y\) are in \([a,b]\text{.}\) A limit of a subsequence is the same as the limit of the sequence, and we can take a limit past the continuous function \(f\text{:}\)
\begin{equation*}
\inf f\bigl([a,b]\bigr) = \lim_{n\to\infty} f(x_n)
= \lim_{i\to\infty} f(x_{n_i}) =
f \Bigl( \lim_{i\to\infty} x_{n_i} \Bigr) = f(x) .
\end{equation*}
Similarly,
\begin{equation*}
\sup f\bigl([a,b]\bigr) = \lim_{n\to\infty} f(y_n)
= \lim_{i\to\infty} f(y_{m_i}) =
f \Bigl( \lim_{i\to\infty} y_{m_i} \Bigr) = f(y) .
\end{equation*}
Hence, \(f\) achieves an absolute minimum at \(x\) and an absolute maximum at \(y\text{.}\)