# $X$ is a topological space s.t. every continuous $f:X\rightarrow \mathbb{R}$ is bounded. Is X compact?

A well-known basic topological result is that if $X$ is a compact topological space, then every continuous function $f:X\rightarrow \mathbb{R}$ is bounded.
That raises the natural question - is the converse also true? Or maybe there exists a non-compact space that still holds that property, "every continuous real function is bounded"?

Possibly surprisingly, the converse is not true. (However, it is true if we additionaly assume that $X$ is metric.)

To see that, let $\mathbb{R_{coco}}$ be the set $\mathbb{R}$ with the cocountable topology. (coco stands for cocountable, of course!). It is not compact: for example, let $A=\mathbb{R_{coco}}-\mathbb{N}$. Then $$A, A\cup\left \{ 1 \right \}, A\cup\left \{ 1,2 \right \}, ...$$ is an open cover with no finite subcover.

However, we'll show that every continuous function $f:\mathbb{R_{coco}}\rightarrow \mathbb{R}$ is constant (and in particular bounded).
Let $x_0\in \mathbb{R_{coco}}$ be arbitrary. Let $U\subset \mathbb{R}$ be an arbitrary open neigborhood of $f(x_0)$ in $\mathbb{R}$. $f^{-1}(U)$ is not empty, but it is open in the cocountable topology and hence cocountable. As a result, if $V$ is an open set (in $\mathbb{R}$) who's disjoint from $U$, then it's inverse image is at most countable, but still open in the coco topology, hence empty. Therefore $Im (f)\subseteq U$. But this is true for every $U$ who's an open neighborhood of $f(x_0)$. Therefore $Im (f)=\left \{ f(x_0) \right \}$ and $f$ is constant.

• What was the purpose of posting this question when you know the answer.
– user87543
Sep 10, 2017 at 18:02
• @PraphullaKoushik "Answer your own question – share your knowledge, Q&A-style" - appears at the bottom of every question you ask. I decided to try it for once. Sep 10, 2017 at 18:04
• I have not seen/observed that. Now I saw that. Fair enough.
– user87543
Sep 10, 2017 at 18:38

The OP may not care anymore, but...

Here is a class of spaces I use frequently in class, merely because they often serve as quick counterexamples to questions like this one. Also, they are incredibly easy to understand for beginners.

Let $X$ be any set and fix once and for all a point $a \in X$. Put a topology on $X$ by declaring $U \subseteq X$ to be open if and only if $a \in U$ (or $U = \varnothing$). This is clearly a topology on $X$; call the resulting space $X_a$.

For this question, it is a simple yet great exercise in definitions to prove that any continuous function $f: X_a \to Y$ is constant if $Y$ is Hausdorff. Moreover, $X_a$ is compact if and only if $|X|$ is finite. So, when $Y = \mathbb{R}$, this squashes all hope for your converse to be true, as being constant is a pretty severe way of being bounded.

• I like it! But you might want: "Let $X$ be any set and fix once..." +1 Sep 11, 2017 at 1:03
• @MikeMathMan : Oh, you are definitely correct. Will fix. Sep 11, 2017 at 1:11

A space $X$ such that every function $fX \to \mathbb{R}$ is bounded is called "pseudocompact", and compact spaces are always pseudocompact. The reverse need not hold, even for nice spaces. The most classical example is $\omega_1$, the first uncountable ordinal in the order topology.

This space is pseudocompact, locally compact, hereditarily normal and not compact.

We can also find topological groups that can serve as examples, like

$\{f: \mathbb{R} \to \{0,1\}: |f^{-1}[\{1\}]| \le \aleph_0\}$ in the product topology inherited from $\{0,1\}^{\mathbb{R}}$, with pointwise addition mod $2$ as operation.