I have a question here on a proposition from a real analysis textbook.
If $K$ is compact metric space and $f$ is continuous on $K$ (here $f: K \to \mathbb{R}$), then there exists $x'$ such that $f(x') = \sup_{x \in K} f(x)$, i.e. $f$ takes on its maximum value.
Here is the proof.
Let $M = \sup_{x \in K} f(x)$ and suppose $f(x) < M$ for every point in $K$. If $y \in K$, let $L_y = (f(y) + M)/2$ and let $\epsilon_y = (M - f(y))/2$. By the continuity of $f$, there exists $\delta_y$ such that $|f(z) - f(y)| < \epsilon_y$ if $d(z, y) < \delta_y$. then $G_y = B(y, \delta_y)$ is an open ball containing $y$ on which $f$ is bounded above by $L_y$. Now $\{G_y\}_{y \in K}$ is an open cover for $K$. Let $\{G_{y_1}, \ldots, G_{y_n}\}$ be a finite subcover. Let $L = \max(L_{y_1}, \ldots, L_{y_n})$. Then $L$ is strictly smaller than $M$. If $x \in K$, then $x$ will be in some one of the $G_{y_i}$, and hence $f(x) \le L_{y_i} \le L$. But this says that $L$ is an upper bound for $\{f(x): x \in K\}$, a contradiction to the definition of $M$. Therefore our supposition that $f(x) < M$ for every $x$ in $K$ cannot be true.
I can follow the proof step to step, but I'm interested in the following: if I were to distill this proof down to its essential idea(s), what would they be? What is the intuition behind the proof of this proposition?