TITLE: $X$ is a topological space s.t. every continuous $f:X\rightarrow \mathbb{R}$ is bounded. Is X compact?
QUESTION [10 upvotes]: 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"?

REPLY [6 votes]: 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.