> [!NOTE] Theorem (EVT)
> If $f:[a,b] \to \mathbb{R}$ is [[Continuous Real Function|continuous]] then $f$ is [[Bounded Real Function|bounded]] and attains its bounds. In other words, $f$ is bounded above and below on $[a,b]$ and there exists $x^{*},x_{*} \in [a,b]$ such that $f(x_{*}) = \underset{x \in [a,b]}{\inf} f(x) \quad \text{ and } \quad f(x^{*})\underset{x \in [a,b]}{\sup} f(x)$
**Proof**. By [[Continuous Real Function on Closed Real Interval is Bounded]], $f$ is bounded aboive on $[a,b].$
Now we show that $x^{*} \in [a,b]$ such that $f(x^{*}) = \underset{x\in [a,b]}{\sup} f(x)$.
Since $f$ is bounded on $[a,b]$, it follows that the set $S = \{ f(x) \mid x \in [a,b] \}$ is bounded.
It is clearly non-empty so $M= \sup S$ exists.
Since $M$ is the [[Supremum of Set of Real Numbers|least upper bound]], for any $\epsilon>0$, $\exists s \in S$ such that $s>M-\epsilon$.
In particular, for each $n \in \mathbb{N}$, choose $\epsilon= \frac{1}{n}$ then we can find $x_{n} \in [a,b]$ such that $M-\frac{1}{n}<f(x_{n}) \leq M.$
Using [[Bolzano-Weierstrass Theorem (Sequential Compactness of The Reals)|BW]], we can find a subsequence $(x_{n_{j}})$ such that $x_{n_{j}} \to x^{*}$ as $j \to \infty$ for some $x^{*} \in [a,b]$.
Since $f$ is sequentially continuous at $x^{*}$, $f(x^{*}) =\lim_{ j \to \infty } f(x_{n_{j}})$.
Since, $M-\frac{1}{n_{j}}<f(x_{n_{j}}) \leq M$, it follows from [[Sandwich Rule]], that $f(x_{n_{j}}) \to M$ so $f(x^{*}) = M$.
For the lower bound consider the function $x \mapsto -f(x)$.
**Another proof that function attains its bounds**: Suppose that $f$ does not attain its supremum on $[a,b]$. Define $M:= \sup_{x \in [a,b]} f(x)$ and $g(x)= 1/(M-f(x))$ which is continuous on $[a,b]$, since its denominator is non-zero and continuous. So $g$ is bounded on $[a,b]$ with $g(x) \leq C \implies f(x) \leq M - 1/C<M$, which contradicts the fact $M$ is the least upper bound for $f$ on $[a,b]$.