Proof (continuous functions bounded on closed intervals)

Suppose $f$ is not bounded. Then for all $n=1,2,3,\ldots$, there exists $x_n\in[a,b]$ where $|f(x_n)| > n$.

Since $x_n$ is bounded, by Bolzano-Weierstrass, there is a subsequence $x_{n_j} \to x$ as $j\to\infty$ for some $x$.

Since $a\leq x_{n_j} \leq b$, we have $a\leq x\leq b$. So by continuity, $f(x_{n_j}) \to f(x)$. However, $|f(x_{n_j})| > n_j \geq j$ so $f(x_{n_j})$ cannot converge, contradiction.