Continuous Function on Compact Space is Bounded

Theorem
Let $\struct {X, \tau}$ be a topological space.

Let $\struct {Y, \norm {\, \cdot \, } }$ be a normed vector space.

Let $f: X \to Y$ be continuous.

Then $f$ is bounded.

Proof
$f$ is not bounded.

Let $A_n = \set {x \in X: \norm {\map f x} < n}$ for every $n \in \N$.

Then each $A_n$ is open, since $A_n = \map {\norm f^{-1} } {-n, n}$.

Moreover, $X = \bigcup A_n$.

Since $X$ is compact, there are $n_1, n_2, \dots, n_m \in \N$ such that $X = \bigcup A_{n_k}$.

However, since $f$ is not bounded, there exists $x \in X$ such that $\norm {\map f X} \ge \max \set {n_1, n_2, \dots, n_m}$, which is a contradiction.