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}$.


How about this example: $[0,1]^A$ with the product topology, where $A$ is uncountable. Then every nonempty $G_\delta$ set is uncountable. Since your sets $f^{-1}(x)$ are $G_\delta$ sets, this has your property.


If $(X,\mathcal{S})$ is a regular space, then the $P$-space coreflection of $(X,\mathcal{S})$ is the space generated by the basis $\{\bigcap_{n\in\omega}U_{n}\mid\forall n\,U_{n}\in\mathcal{S}\}$. A completely regular space $X$ satisfies the property that $f^{-1}(\{x\})$ is empty or infinite for any real $x$ if and only if the $P$-space coreflection of $X$ has no isolated points.

There exists infinite regular spaces $X$ where every continuous function $f:X\rightarrow\mathbb{R}$ is constant and in such spaces $f^{-1}(x)$ is always empty or infinite.