Proof (extreme value theorem)

First we'll prove a lemma:

Lemma (continuous functions bounded on closed intervals) open_in_new

Suppose $f: [a,b]\to\R$ is continuous. Then there exists $K$ such that $|f(x)| < K$ for all $x\in[a,b]$.

Proof

Proof (continuous functions bounded on closed intervals) open_in_new

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.

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$.