TITLE: Is there a canonical way to connect a topological space?
QUESTION [16 upvotes]: It is known that each topological space $X$ admits a Hausdorffization - which means that every topological space can be "approximated" by the corresponding unique Hausdorff space for which each continuous mapping from $X$ to a Hausdorff space factors uniquely through the Hausdorffization.
For given topological space is it possible to connect it in a canonical way, i.e. to find a corresponding connected space with the property as above?

REPLY [15 votes]: No, it is not true. Consider $X = \{0,1\}$ a set with two elements, endowed with the discrete topology. Suppose there were a connected space $X'$ and a continuous map $i : X \to X'$ such that for all connected spaces $Y$ and for all continuous maps $f : X \to Y$, there exists a unique map $f' : X' \to Y$ such that $f' \circ i = f$.
Then first I want to show that $i$ is injective. For this consider $f : X \to [0,1]$ the inclusion. Then there exists a unique map $f' : X' \to [0,1]$ such that $f' \circ i = f$. But $f$ is injective, therefore so is $f'$ (consider that if $i(0) = i(1)$, then $f(i(0)) = f(i(1)) \implies 0 = 1$).
Next I want to show that $i$ is surjective. Let $Y = \{a,b\}$ be a set with two elements, endowed with the trivial topology (the only open sets are $\varnothing$ and $Y$). Consider $f : X \to Y$, $f(0) = a$, $f(1) = b$. Then $f$ is continuous, hence there exists a unique map $f' : X' \to Y$ such that $f' \circ i = f$.
Now suppose to the contrary that $i$ weren't surjective. Then I can find two different continuous maps $f' : X' \to Y$ such that $f' \circ i = f$. Either I can send all the elements of $X' \setminus \{i(0), i(1)\}$ to $a$, or I can send them to $b$, while in both cases I map $i(0) \mapsto a$ and $i(1) \mapsto b$. That's a contradiction, hence $i$ is surjective.
It follows that $i$ is bijective, and $X'$ has two elements, $i(0)$ and $i(1)$. But if I consider again $f : X \to [0,1]$ the inclusion, then I find that $i(0)$ and $i(1)$ must be separated by open sets (the preimages of, say, $[0,1/4)$ and $(3/4,1]$ by the induced map $f' : X' \to [0,1]$). Hence $X'$ is actually discrete, which is contradictory with it being connected.