Proof. First, some preliminaries: Recall that the
diagonal map $\Delta\co X\to X\times X$ is defined as
$x\stackrel{\Delta}{\longmapsto}(x,x)$ Also recall that in a
topology generated by a basis (like the product topology), a set
$Y$ is
open if and only if, for every
point $y\in Y$ there's a basis element
$B$ with
$y\in B\subset Y$ Basis elements for
$X\times X$ have the form
$U\times V$ where
$U,V$ are open sets in
$X$
Now, suppose that $X$ is Hausdorff. We'd like to show its image under $\Delta$ is closed. We can do that by showing that its complement $\Delta(X)^c$ is open. $\Delta(X)$ consists of points with equal coordinates, so $\Delta(X)^c$ consists of points $(x,y)$ with $x$ and $y$ distinct.
For any $(x,y)\in \Delta(X)^c$ the Hausdorff condition gives us disjoint open $U,V\subset X$ with $x\in U, y\in V$ Then $U\times V$ is a basis element containing $(x,y)$ $U$ and $V$ have no points in common, so $U\times V$ contains nothing in the image of the diagonal map: $U\times V$ is contained in $\Delta(X)^c$ So $\Delta(X)^c$ is open, making $\Delta(X)$ closed.
Now let's suppose $\Delta(X)$ is closed. Then $\Delta(X)^c$ is open. Given any $(x,y)\in\Delta(X)^c$ there's a basis element $U\times V$ with $(x,y)\in U\times V\subset\Delta(X)^c$ $U\times V$ lying in $\Delta(X)^c$ implies that $U$ and $V$ are disjoint.
If we have $x\neq y$ in $X$ then $(x,y)$ is in $\Delta(X)^c$ The basis element containing $(x,y)$ gives us open, disjoint $U,V$ with $x\in U, y\in V$ $X$ is Hausdorff, just like we wanted. 