Let $(X,d)$ be a metric space and $f: X \rightarrow [0, \infty )$ be a continuous function. Assume that for any $\epsilon > 0$, there exists a compact set $K_\epsilon \subseteq X$ such that $f(x) < \epsilon$ whenever $x \notin K_\epsilon.$ Show that $f$ has a maximum point.
Well, for any $\epsilon > 0$, we have a compact set $K_\epsilon$ such that if $f(x) \geq \epsilon$ then $x \in K_\epsilon$. Since each $K_\epsilon$ is compact and since $f$ is continuous, I know that $f$ obtains a maximum on each non-empty $K_\epsilon$. One of these must be the biggest, so $f$ has a maximum point? Is there a better way?