A characterization of compact sets in $\mathbb R$ via functions: is it a general result?

Prove that if $X\subset \mathbb R$ and if every continuous function $f:X \to \mathbb R$ is bounded. Then $X$ is compact.

My proof in $\mathbb R$ is only this. It's clear that if $X$ is compact, it's true. If $X$ is not compact in $\mathbb R$, it's because it's not bounded, and in this case for example, the identity function is continuous on $X$ (restriction of continuous function are continuous because are the composite of the inclusion of $X$ on $\mathbb R$ and the identity on $\mathbb R$, and both are continuous). If it's not closed, it doesn't have some limit point, say $a$; I think that the function $f ( x) = \frac{1} {{x - a}}$ is continuous and also unbounded ( I'm not completely sure of the continuity).

Here I used the characterization via closed and bounded, but, how general is this result? It is true in metric spaces? Or in topological spaces? My proof will not serve for this cases.

-
The proof is about the same for $\Bbb{R}^p$. For general metric spaces it is not true in general, since compact sets are not characterized the same as in $\Bbb{R}^p$. –  Beni Bogosel Oct 29 '11 at 15:29
Well, I Know that it´s true for spaces such that compact are equivalent to closed and bounded, But I can not say that it is false in all other cases, just because my proof is not valid in these... –  August Oct 29 '11 at 15:32
A metrizable space is compact if and only if every compatible metric is bounded. See this answer. The idea is that if the space is not compact, there is a sequence $\{x_n\}$ without convergent subsequence (in particular it is closed and discrete), so you can define a function $f:\{x_n\} \to \mathbb{R}$ by $f(x_n) = n$, which is continuous. Tietze's extension theorem lets you extend this function to a continuous function $F$ on all of $X$, so there is an unbounded continuous function. –  t.b. Oct 29 '11 at 15:44

1 Answer

A Tikhonov space $X$ (= completely regular $T_1$-space) with the property that every continuous real-valued function on $X$ is bounded is said to be pseudocompact. Such spaces are not necessarily compact, though if they are normal, they are countably compact. In the other direction, every countably compact Tikhonov space is pseudocompact.

The space $\omega_1$ of countable ordinals with the order topology is countably compact and Tikhonov (in fact hereditarily normal), so it’s pseudocompact, but it is not compact. However,

• a pseudocompact Tikhonov space is compact if and only if it is metacompact,
• every metric space is paracompact, and
• paracompactness implies metacompacness,

so every pseudocompact metric space is compact.

You can find some basic information and references on pseudocompact spaces here.

-