# A property of subspaces of a topological space

Let $X$ be a topological space and $A$ be a subset of $X$. Is there any nice condition on $A$ equivalent to the property that if $C$ is a connected component of $X$, then either $A\cap C=\emptyset$ or for every continuous real valued function $f$ on $X$ (i.e, $f\in C(X)$) if $f(A\cap C)\subseteq\{0, 1\}$, then $f$ must be constant on $A\cap C$?

For example, dense subspaces of $X$ have this property. Also, connected components of $X$ have this property.

• Incidentally, there is no need for the disjunction in your statement: if $A \cap C = \emptyset$, then the condition on continuous functions is automatically satisfied. – LSpice Aug 23 '18 at 17:36
• Your remark about dense subsets is incorrect. Consider the space $X=(\{0\}\times [0,1])\cup \bigcup \{\{1/n\}\times [0,1]:n=1,2,3,...\}$. Let $A=\{\langle 0,0\rangle,\langle 0,1\rangle \} \bigcup \{\{1/n\}\times (\mathbb Q\cap [0,1]):n=1,2,3,...\}$. Define $f:X\to \mathbb R$ by $f(\langle x,y\rangle)=y$. Then $A$ is dense in $X$, $f[A\cap C]\subseteq \{0,1\}$, but $f$ is not constant on $A\cap C$. – D.S. Lipham Aug 25 '18 at 0:10
• In my previous comment, $C$ was meant to be the component $\{0\}\times [0,1]$. – D.S. Lipham Aug 26 '18 at 16:30