Proof (extreme value theorem)
First we'll prove a lemma:
Let $A = \sb{f(x)}{x\in[a,b]}$. From lemma, $A$ is bounded, so it has a supremum $M$.
Proof 1
From the definition of a supremum, for all $n\in\N$, there exists $y_n\in A$ such that $M-1/n \leq y_n \leq M$. Let $x_n\in[a,b]$ be such that $f(x_n) = y_n$.
Since $(x_n)$ is bounded, by Bolzano-Weierstrass, there is a subsequence $x_{n_j} \to Y$ for some $Y\in[a,b]$. Using continuity, $$ f(Y) = \lim_{j\to\infty} f(x_{n_j}) = M. $$ Hence $f(x) \leq f(Y)$ for all $x\in[a,b]$.
Proof 2
Suppose $f(x)\neq M$ for any $x\in[a,b]$. Then $$ \begin{align*} g(x) = \frac{1}{M-f(x)} \end{align*} $$ is well-defined and continuous on $[a,b]$, so $g(x)$ is therefore bounded.
Letting $g(x)\leq m$ for all $x\in[a,b]$, we have $f(x) \leq M-\frac{1}{m} < M$, which contradicts with $M$ being a supremum.
For a lower bound, either consider the infimum of $A$ and argue similarly, or apply the above to $-f$.