TITLE: Prove that if Diagonal is open in Product Topology, then the original topology is discrete
QUESTION [5 upvotes]: I found the following exercise in Introduction to Metric and Topological Spaces by Sutherland (Chapter 10 Question 20).
Prove that the topology on a space X is discrete iff the diagonal $\Delta=\{ (x,x) \mid x\in X\}$ is open in the topological product $X \times X$. 
I believe I could prove in the $implies$ direction. It is the converse that got me stuck.
So,I would want to prove that if the diagonal is open in the topological product then the topology on $X$ must be discrete.
I was thinking that I could achieve the result if I could show that every singleton $\{ x\}$ is open in $X$, but I couldn't think of a way to establish this. I tried considering $X-\{ x\}$ and try to show that it's closed but  I couldn't continue to anything fruitful. Also, I think I could use projection maps but I am stumped as well.
Any help/hint is appreciated. Thanks in advance.

REPLY [4 votes]: The basis for the product topology of $X\times X$ is $\{U\times V:U,V \text{ open in $X$}\}.$ Assuming that the diagonal $\Delta$ is open, then every $(x,x)\in\Delta$ is contained in a basis element which is in turn contained in $\Delta$. The only set of the form $A\times B$ such that $A,B\subset X$ and $(x,x)\in A\times B\subset \Delta$ is $A=B=\{x\}$, so $\{x\}$ is open in $\Delta$.

REPLY [2 votes]: HINT: Suppose that $\{x\}$ is not open. Let $A=X\setminus\{x\}$. Then every open nbhd of $x$ intersects $A$. What can you say about open nbhds of $\langle x,x\rangle$ in $X\times X$? If that’s not quite enough, I’ve left a further hint in the spoiler-protected block below.

 Consider how $\langle x,x\rangle$ is related to $A\times\{x\}$ in $X\times X$.