True Or not: Compact iff every continuous function is bounded [duplicate]
Let $X = [0,\omega_1)$. Then $X$ is non-compact as the $[0,\alpha)$, $\alpha < \omega_1$ form an open cover without even a countable subcover.
On the other hand, let $f \colon X \to \mathbb R$ continuous. Suppose $f%$ were unbounded. Then there is a sequence $\alpha_n < \omega_1$ such that $f(\alpha_n) \ge n$. As $[0,\alpha]$ is compact for $\alpha < \omega_1$ and $f$ is continuous, $f([0,\alpha])$ is bounded. So we may arrange that $\alpha_{n+1} > \alpha_n$ for $n < \omega$. Let $\alpha^* = \sup_n \alpha_n$. By continuity $f(\alpha^*) = \lim_n f(\alpha_n)$. But $f(\alpha_n) \ge n$ for each $n$. Contradiction, hence $f$ is bounded.
To complement Martini's answer, one may add that if the space $X$ is $metrizable$, then the answer is "yes".
Indeed, assume that $X$ is metrizable and not compact. Then one can find a sequence $(x_n)_{n\in\mathbb N}\subset X$ with $x_n\neq x_m$ if $n\neq m$, such that the set $C=\{ x_n;\; n\in\mathbb N\}$ is discrete in the topology induced by $X$. Then the function $f_0=C\to\mathbb R$ defined by $f_0(x_n)=n$ is continuous and unbounded. Moreover, $C$ is closed in $X$, so by Tietze's extension theorem $f_0$ can be extended to a continuous (and unbounded!) function $f:X\to\mathbb R$.
Apologies: I did not notice that Davide Giraudo gave the same answer in a comment above.