The distance function is defined as
$d\left ( x,y \right )=\left | x-y \right |= \begin{cases} x-y, &\text{if }x\geq y \\ y-x,&\text{otherwise} \end{cases}$
For $d\left ( x,y \right )$ to be a metric, it must be non-negative, symmetric and satisfy the triangle inequality.
I'm unable to show that it satisfies the triangle inequality on R.
Help is appreciated.
Thanks in advance.