Let $M$ be a metric space. If every continuous function $f : M \rightarrow \mathbb{R}$ has compact range then $M$ is compact.
Compactness of $(M, d)$ in terms of continuous functions $f:M\to \mathbb R$