The Sierpiński space is defined like so: $$S = (\{\top, \bot\}, \{\emptyset, \{\top\}, \{\top, \bot\}\})$$ (A nice way to visualize is to take [0, 1], and glue 0 on $\bot$ and (0,1] onto $\top$.)
Now, given a topological space $X$, we can define a function $\ne:X \times X \to S$, where $X \times X$ has the product topology, like so. $$a \ne b \begin{cases} \bot & \text{if } a = b \\ \top & \text{otherwise} \end{cases}$$ I saw it claimed somewhere on mathoverflow that $\ne$ is continuous iff $X$ is hausdorff (for every two points $a$ and $b$ in $X$, there are open sets $A \ni a$ and $B \ni b$, such that $A \cap B = \emptyset$). Is this true? What is the proof?
Suppose that $\neq:X\times X\to S$ is continuous. Let $E\subseteq X\times X$ be defined as $\neq^{-1}(\{\top\})$, the inverse image of $\{\top\}$ under the function $\neq$. Since $\neq$ is continuous and $\{\top\}$ is open in $S$, if follows that $E$ is open in the product topology. In fact, $E=\{(x,y)\in X\times X\,|\,x\neq y\}$ by the definition of $\neq$.
Now pick any two distinct points $x,y\in X$. Then, $(x,y)\in E$. Since $E$ is open in the product topology, there exist open sets $U,V\subseteq X$ such that $(x,y)\in U\times V\subseteq E$. Now, $U$ and $V$ must be disjoint, for if $z\in U\cap V$, then $(z,z)\in U\times V\subseteq E$, so that $z\neq z$, which is impossible. Hence, one has that
This shows that $X$ is a Hausdorff space.