If \( X \) is a compact space and \( f: X \to \mathbb{R} \) is continuous , then \( f \) is bounded and attains maximum and minimum values on \( \mathbb{R} \).

Proof
By the main theorem , \( f(X) \) is compact and due to Heine–Borel , it is bounded and closed. In particular, it contains its supremum and infimum.