Is there a Hausdorff topological space $X$ such that for any continuous map $f: X\longrightarrow \mathbb{R}$ and any $x\in \mathbb{R}$, the set $f^{-1}(x)$ is either empty or infinite? 



A rare property of Hausdorff spaces
Yes, there is such a space. Let $X=2^{\omega\_1}$ be the space of
binary sequences of length $\omega\_1$, in the order topology
generated by the lexical order. So $X$ consists of the branches
through the tree $2^{<\omega\_1}$, with the left-to-right order on
branches. This is an order topology of a linear order and hence
Hausdorff.


The key thing to notice is that every element $a\in X$ is the limit
of an $\omega\_1$-sequence. If $a\_\alpha\to a$ for $\alpha<\omega\_1$ and
$f:X\to\mathbb{R}$ is continuous, it follows that $f(a\_\alpha)\to
f(a)$. Since every convergent $\omega\_1$-sequence in the reals is eventually constant, it must be that $f(a\_\alpha)=f(a)$ for all
sufficiently large countable ordinals $\alpha$. So this space has
your desired property.


In fact, I claim that for every continuous function $f:X\to\mathbb{R}$ and every $a\in X$, the function is constant on an interval about $a$. To see this, we may find open intervals in $\mathbb{R}$ so that $\{f(a)\}=\bigcap\_n I\_n$, and then $f$ is constant on $\bigcap\_n f^{-1}I\_n$. Each such $f^{-1}I\_n$ is an open set containing $a$, and since there are only countably many, we may find an interval containing $a$ inside all of them. 


Thus, this space has the property that every continuous function $f:X\to\mathbb{R}$ is locally constant, and every nonempty open set has size $2^{\omega\_1}$. 


