Topological space $X$ which the set of non-constant real-valued continuous function on $X$ is empty Let $X$ be a non-empty and topological space. The set of all real-valued continuous function and all non-constant real-valued continuous function on $X$ is denoted by $C(X)$ and $NC(X)$, respectively.
Clearly, $C(X)\not=\emptyset$ since every constant function on $X$ is continuous. Also, if $|X|=1$, then $NC(X)=\emptyset$.
Does there exists a topological space $X$ with $|X|>1$ and non-trivial, which $NC(X)=\emptyset$. In the other words, does there exists a topological space $X$ with $|X|>1$ such that every real-valued continuou functions on $X$ is constant?
 A: Sure, take any space $X$ endowed with the trivial topology.
Edit: There are also nontrivial examples, for example consider $\{\emptyset, A, X\}$ for any arbitrary subset $A \subset X$.
A: Another non-trivial example:
Let $X$ be an infinite set and $\mathcal T$ the co-finite topology on $X$. Then $C(X)$ consists of only constant functions.
A: You can see this paper by Edwin Hewitt, where it is proved that for every cardinal number $\aleph$ which is not the sum of $\aleph_0$ cardinal numbers less than $\aleph$, there exists a Hausdorff space $X$ with $|X|=\aleph$ such that every continuous real function on $X$ is constant.
Some examples by Urysohn and Pospišil are mentioned.
Theorem 2 in the paper by Hewitt exhibits a countable Hausdorff space on which every continuous real function is constant. The construction is due to R. F. Arens.



*

*Edwin Hewitt, On two problems of Urysohn, Annals of Mathematics
Second Series, Vol. 47, No. 3 (Jul., 1946), pp. 503–509

*Paul Urysohn, Über die Mächtigkeit der zusammenhängenden Mengen, Mathematische Annalen, 94 (1925), 262–295

*Bedřich Pospišil, Trois notes sur les espaces abstraites, Spisy vidáváne přirodoveckou Fakultou Masarykovy Univerzity, Čis. 249, 1937
