# Given a disconnected subset of $X$, make a continuous function on $X$ that has value 0 and 1 on each component of separation

Suppose $X$ is a topological space and $A\cup B$ is a disconnected subset of $X$ where $(A,B)$ is a separation of $A\cup B$.

Does this imply the existence of a continuous function $f : X \rightarrow [0,1]$ such that $f(A)=0$ and $f(B)=1$?

If not, what kind of additional conditions are needed?

• If such a function existed, then $\overline{A}$ and $\overline{B}$ are functionally separated, which is way stronger than being a separation of their union. Commented Sep 20, 2014 at 11:45

Assume such a function exists. By continuity $f$ is zero on $\bar A$ and $f$ is $1$ on $\bar B$. This implies $\bar A \cap \bar B = \emptyset$. Therefore, a necessary condition is $\bar A$, $\bar B$ disjoint. This is a stronger condition than $A$, $B$ form a separation of $A\cup B$ which is equivalent to $\bar A \cap B = \emptyset$ and $A \cap \bar B = \emptyset$.

The condition $\bar A \cap \bar B = \emptyset$ implies the existence of such a function if $X$ is moreover normal ( Urysohn separation theorem).

• So you mean if $\bar{A}\cup\bar{B} = \emptyset$ is given and $X$ may not be normal, then such a function may not exist, right?? What can be a counter-example?? Commented Sep 21, 2014 at 3:33
• Of course you mean $\bar A \cap \bar B = \emptyset$. Yeah, there are fairly decent topological spaces such that any real continuous function is constant. Morever, these spaces will have lots of examples of pairs of subsets $A$, $B$ with $\bar A \cap \bar B = \emptyset$. Yes, these spaces can be taken to be regular-- edited the link in the answer above, check it out. Commented Sep 21, 2014 at 4:10

In general, this is not true. If $A$ and $B$ are closed, then one additionally needs that $X$ is normal, in which case the assertion is a special case of the Tietze Extension Theorem. In particular, both metric spaces and compact Hausdorff spaces are normal.

You can find some related discussion and counterexamples in answers to this related question: Example where Tietze Extension fails?

• Do we need the normality in the whole space $X$, or just the existence of two disjoint open sets that contains each of $A$ and $B$?? Commented Sep 20, 2014 at 12:01

Consider $A = \{0\}$, $B = \{1\}$ and $X = \{*,0,1\}$ where a basis of open sets is given by $\{*,0\}$ and $\{*,1\}$.