EVT: Let $f: [a,b] \to \mathbb{R}$ be continuous, then $f$ achieves maximum and minimum
I think it is very easy to prove using continuous image of compact is compact + Heine Borel but I am stuck on showing that the $\sup$ and $\inf$ are actually $\max$ and $\min$
Proof attempt:
Since $[a,b]$ is compact, $f$ continuous, therefore $f([a,b])$ is compact.
By Heine Borel, $f([a,b])$ is closed and bounded. By boundedness, $f([a,b]) \subseteq [-N,N], N \in \mathbb{R}_{+}$.
Let $u := \sup f([a,b])$, then we wish to show that $u \in f([a,b])$
I'm guessing if I were to continue, it would be something like this. Since $u$ is the $\sup f([a,b])$, then there exists $u_1 \in [u-\epsilon, u]$ for some $\epsilon >0$, otherwise $u$ is not the supremum. Then we can find $u_2 \in [u_1-\epsilon, u]$...this builds a Cauchy sequence. Since any closed interval in $\mathbb{R}$ is complete, the Cauchy sequence converges. Since $f([a,b])$ is closed, and $u_1, u_2,\ldots$ converges to $u$, therefore $u \in f([a,b])$.
Is this correct?
Note: I realized that the above would rely on sequential compactness rather than covering compactness. What is another way to prove this that is more topologically oriented?
Since the image is compact, the supremum (now seen as the supremum of the set of attained values of $f$) does belong to the image (as a set). (A compact set contains its supremum.) But what does it mean for a value $y$ to be in the image? It means that there is an $x$ in the domain such that $f(x)=y$.