If $(X,\tau)$ is a topological space, we can consider the product topology on $X\times X$ and take the closure of the diagonal $\Delta\_X = \{(x,x): x\in X\}$, which we denote by $\mathrm{cl}(\Delta\_X)$. Obviously, $\mathrm{cl}(\Delta\_X)$ is a symmetric binary relation.


Now we can take things upside down: Let $X$ be a set and let $R\subseteq X\times X$ be a reflexive and symmetric relation. Is there a topology $\tau$ on $X$ such that $\mathrm{cl}(\Delta\_X)=R$?



Binary relations as the topological closure of the diagonal
The answer is no, not necessarily. For a counterexample, let $X=\mathbb{R}$ and let $aRb\iff a=b \text{ or } |a-b|\geq 1$, the "equal or differ by at least one" relation. This is symmetric and reflexive. Suppose $\tau$ is a topology on $\mathbb{R}$ with $\text{cl}(\Delta)=R$. For any real number $k$, the $k^{\rm th}$ slice in the plane leads to $(k-1,k)\cup(k,k+1)$ being open with respect to $\tau$. By taking intersections of such sets, we get tiny open intervals $(a,b)$ being open, and this violates $\text{cl}(\Delta)=R$. 


