[Math] Bounded continuous function and closed subset of $\Bbb R$ is compact

general-topology

Let $X$ be a closed subset of $\Bbb R^2$. Prove that $X$ is compact if, and only if, every continuous function $f:X \to \Bbb R$ is bounded.

So far I have:

Assume X is compact and X is a closed subset of $ \Bbb R^2$.

The continuous image of a compact set is compact (Theorem 26.5)

$f[X] \subset \Bbb R$

All compact sets in $\Bbb R$ are bounded, because $\Bbb R$ is metrizable.

Therefore, $f$ is bounded (By definition).

Conversely, I don't believe it is true. Am I right that every continuous function is bounded does not imply that $X$ is compact?

Best Answer

Here a proof of the missing "arrow"

Suppose $X$ is a closed subset of $\mathbb R^2$, and suppose that any contiunuos function on $X$ is bounded.

Let $p\in\mathbb R^2$ and set $f(x)=d(x,p):X\to\mathbb R$. $f$ is clearly continuous, whence it is bounded.

Hence $X$ is a closed and bounded subset of $\mathbb R^2$ and therefore is compact.