Lemma 5.3.1. Let $X$ be a topological space. The following are equivalent:

1. $X$ is Hausdorff,

2. the diagonal $\Delta (X) \subset X \times X$ is closed.

Proof. We suppose that $X$ is Hausdorff. Let $(x, y) \not\in \Delta (X)$, i.e., $x \neq y$. There are $U$ and $V$ disjoint open sets of $X$ such that $x \in U$ and $y \in V$. This implies that $U \times V \subset (X \times X) \setminus \Delta (X)$. This shows that $(X \times X) \setminus \Delta (X)$ is an open set of $X \times X$ which is equivalent to say that the diagonal $\Delta (X) \subset X \times X$ is closed in $X \times X$. The converse is similar: The complement $(X \times X) \setminus \Delta (X)$ consist precisely of $(x, y) \in X\times X$ with $x \neq y$. Thus, if $\Delta (X) \subset X \times X$ is closed, then, by the definition of the product topology, for every such $(x, y)$, there are opens $U, V \subset X$ with $(x, y) \in U \times V$ and $(U \times V)\cap \Delta (X) = \emptyset$. In other words, with $x \in U$ and $y \in V$ such that $U \cap V = \emptyset$. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).