Does $d (x,y)= (x-y)^2$ define metric on a set of real numbers? It is a question in functional analysis by writer Erwin Kryzic 

Ok. The problem is the triangle inequality, then: 
Let $x,y,z \in \mathbb{R}$, so $$d(x,z) = (x+y-y+z)^2$$ $$d(x,z) = ((x-y)+(y-z))^2$$ $$\qquad d(x,z)  = d(x,y)+2(x-y)(y-z)+d(y,z)$$ $$d(x,z) \geq d(x,y)+d(y,z)\quad iff\quad (x-y)(y-z)\geq0$$
Then, suppose what $x=3$, $z=1$, $y=2$, that which does not meet the triangular inequality, therefore, $d$ is not a metric
