Topological spaces with nowhere locally constant functions to the reals I would like a nice characterization of topological spaces with continuous functions to the reals which are nowhere locally constant, i.e. not constant on any (non-empty) open set. For sure, the property I just gave is itself a characterization. I just wouldn't call it nice. Spaces with this property can look very different from one another. For examples, the rationals (and the identity function), the irrationals (and the identity function), $\mathbb{R}^n$ (and projection), Cantor space.
 A: Some partial answers to this problem are given by the following theorems.
Theorem 1. Every submetrizable space $X$ of density $<\mathfrak c$ admits a continuous nowhere locally constant real-valued function.
Proof. Let $D$ be a dense set of cardinality $<\mathfrak c$ in $X$. Being submetrizable, the space $X$ admits a bijective continuous map $\varphi:X\to M$ onto a metrizable space. It follows that $\varphi[D]$ is a dense set in $M$ and hence $M$ has density $<\mathfrak c$. Repeating the trick from the proof of Proposition 1 in this paper, one can show that the metrizable space $M$ admits a bijective continuous map $\psi:M\to Y$ onto a metrizable separable space $Y$. Then $g=\psi\circ\varphi:X\to Y$ is a bijective continuous map from $X$ onto the metrizable separable space $Y$.
Take any metrizable compactification $K$ of $Y$, and consider the Banach space $C(K)$ of all continuous real-valued functions on $K$. Observe that for any distinct points $a,b\in D$ the set $H_{a,b}=\{f\in C(K):f(g(a))=f(g(b))\}$ is a closed hyperplane in $C(K)$.
The metrizability of $K$ implies that the Banach space $C(K)$ is separable. By an old result of Klee (see Proposition 13 of this paper), a separable Banach space cannot be covered by less than continuum closed hyperplanes. In particular, the separable Banach space $C(K)$ cannot be covered by the closed hyperplanes $H_{a,b}$ where $a,b\in D$, $a\ne b$. So, there exists a function $f\in C(K)$ such that $f\circ g(a)\ne f\circ g(b)$ for any distinct points of the set $D$.
The density of the set $D$ in the crowded space $X$  implies that the function $f\circ g:X\to\mathbb R$ is locally nowhere locally constant (being injective on the dense set $D$). $\quad\square$
A subset of a topological space is called $\sigma$-discrete if it can be written as the union of countably many closed discrete subsets.
Theorem 2. Every crowded normal space with a dense $\sigma$-discrete subset admits a nowhere locally constant continuous real-valued function.
Proof. Let $D$ be a dense $\sigma$-discrete set in a normal space $X$. Write $D$ as the union $\bigcup_{n\in\omega}D_n$ of pairwise disjoint closed discrete subsets in $X$. Fix a sequence $(Q_n)_{n\in\omega}$ of pairwise disjoint dense subsets in the real line.
Using Urysohn Lemma, construct inductively a sequence of continuous functions $f_n:X\to \mathbb R$ such that for every $n\in\mathbb N$ the following conditions hold:
$\bullet$ $f_n(x)=f_{n-1}(x)$ for every $x\in\bigcup_{k<n}D_k$;
$\bullet$ $f_n[D_n]\subseteq Q_n$;
$\bullet$ $\sup_{x\in X}|f_n-f_{n-1}|\le\frac1{2^n}$.
The last condition implies that the function sequence $(f_n)_{n\in\omega}$ converges uniformly to some continuous function $f:X\to\mathbb R$. The first two inductive conditions imply that $f[D_n]\subseteq Q_n$ for every $n\in\omega$.
This ensures that $f$ is nowhere locally constant. Indeed, for any nonempty open set $U\subseteq X$ choose any point $x\in U\cap D$ and find $n\in\omega$ such that $x\in D_n$. Since the set $D_n$ is closed and discrete in the crowded space $X$, the open set $U\setminus D_n$ is not empty and hence contains some point $y\in D_m$ with $m\ne n$. It follows from $f(x)\in f[D_n]\subseteq Q_n$, $f(y)\in f[D_m]\subseteq Q_m$ and $Q_n\cap Q_m=\emptyset$ that $f(x)\ne f(y)$, so $f{\restriction}_U$ is not constant and we are done. $\quad\square$
Corollary. Every crowded metrizable space admits a locally nowhere constant continuous real-valued function.
Theorems 1 and Corollary 2 suggest the following
Problem. Is it true that every crowded submetrizable space (of density $\mathfrak c$) admit a nowhere locally constant continuous real-valued function?
A: By Gelfand duality, the category of abelian $C^*$-algebras is contravariantly equivalent to the category of all compact Hausdorff spaces, so it may be a good idea to try to characterize properties of topological spaces in terms of their dual abelian $C^*$-algebras and also in terms of the rings of continuous functions.
Let $C(X)$ denote the ring of all continuous functions $f:X\rightarrow\mathbb{R}$. Let $C^*(X)$ denote the ring of bounded continuous functions $f:X\rightarrow\mathbb{R}$. Observe that $C^{*}(X)\simeq C^{*}(\beta X).$ Let $C^{*}_{\mathbb{C}}(X)$ denote the $C^{*}$-algebra of all bounded continuous functions $f:X\rightarrow\mathbb{C}$. Observe that $C^{*}_{\mathbb{C}}(X)\simeq C^{*}_{\mathbb{C}}(\beta X)$ and recall that $C^{*}_{\mathbb{C}}(X)$ is the dual $C^*$-algebra to the space $X$.
Observation: Let $X$ be a completely regular space. Then the following are equivalent.

*

*Every continuous function $f:X\rightarrow\mathbb{R}$ is constant on some non-empty open set.


*For each $f\in C(X)$, there exists a $g\in C(X)\setminus\{0\}$ and a constant $\lambda$ with $fg=\lambda g$.


*For each $f\in C^*(X)$, there exists a $g\in C^*(X)\setminus\{0\}$ and a constant $\lambda$ with $fg=\lambda g$.


*For each Hermitian $f\in C^*_{\mathbb{C}}(X)$, there exists a $g\in C^*_{\mathbb{C}}(X)\setminus\{0\}$ and a constant $\lambda$ with $fg=\lambda g$.
