# $f \in \mathcal{C}_{0}(X) \Rightarrow \sup_{x \in X} |f(x)| = \max_{x \in X} |f(x)|$

For a topological space $X$ we define $$\mathcal{C}_{0}(X) : = \left\lbrace f \colon X \longrightarrow \mathbb{C} \ \text{continuous} \colon \forall \, \varepsilon >0 \ \exists \, K \subseteq X \ \text{kompact} \ \forall \, x \notin K \colon |f(x)| < \varepsilon \right\rbrace.$$

How can I show that for $f \in \mathcal{C}_{0}(X)$ we have that $\sup_{x \in X} |f(x)| = \max_{x \in X} |f(x)|$?

You take $\epsilon = \sup_{x\in X} |f(x)|$, then there exist a compact K such that $|f(x)| < \frac{\sup_{x\in X} |f(x)|}{2}$ outside of $K$
And as $K$ is compact and f continuous, $\sup_{x\in K} |f(x)| = \max_{x\in K} |f(x)|$.
Hence $$\sup_{x\in X} |f(x)| = \sup_{x\in K} |f(x)| = \max_{x\in K} |f(x)| =\max_{x\in X} |f(x)|$$