Showing the diagonal on $\mathbb{R}^2$ is closed $D=\{{(x,x)|x\in\mathbb{R}}\}$ , I want to show D is closed with the definition: 

$A$ is closed if and only if $\mathbb{R}/A$ is open.

So basically what I really want to show is $A=\{{(x,y)\in \mathbb{R}^2|x\neq y\}}$
.
My attemp so far was taking $a=(x,y)\in A$ and an open ball $B(a,r)$ with $r=\frac {|x-y|} {2\sqrt 2}$, which is the distance between $a$ and the line $x-y=0$, divided by two.
It is easy to see geometrically why a ball with this radius is contained in A, but I wasn`t able to complete the proof formally, using algebra.

Your approach is fine. In fact (as you can see geometrically), there's no need to divide by $2$. In other words, you can take $r=\frac{|x-y|}{\sqrt2}$. I will prove that the open disk $D\bigl((x,y),r\bigr)$ contains no element of $D$, that is, I will prove that if $z\in\mathbb R$, then $\bigl\|(x,y)-(z,z)\bigr\|\geqslant r$. In fact,\begin{align}\bigl\|(x,y)-(z,z)\bigr\|<r&\iff(x-z)^2+(y-z)^2<\frac{(x-y)^2}2\\&\iff2\bigl((x-z)^2+(y-z)^2\bigr)<(x-y)^2\\&\iff x^2+y^2+4z^2+2xy-4xz-4yz<0\\&\iff(x+y-2z)^2<0,\end{align}which is impossible, of course.
