# Proving triangle inequality holds for a specific metric.

I am trying to prove that d is a metric. I have shown the first two properties but I am having trouble proving the triangle inequality holds. $$d(x,y)= \begin{array}{cc} \{ & \begin{array}{cc} |x| + |x-y| + |y| & \text{if} \; x \ne y \\ 0 & \text{if} \; x = y \end{array} \end{array}$$ I know I need to show $d(x,z) \le d(x,y) + d(y,z)$ but with so many absolute value signs I am a little confused as to how to manipulate $d(x,z)$. Any help would be greatly appreciated.

Let $x,y,z \in \mathbb R$. If any two of them or all or them are equal, then the triangle inequality, which is $d(x,y) + d(y,z) \geq d(x,z)$ is trivial, since if $x=y$, then $d(x,z) = d(y,z)$ and the other term is zero. If $y =z$ then $d(x,z) = d(y,x)$ and the other term is zero, and if $x=z$ then the right hand side is zero anyway.
So we assume that they are unequal. Then $$d(x,y) + d(y,z) = (|x| + |y|) + (|y | + |z|) +( |x-y|+|y-z|) \\\quad\quad\ \ \ \ \geq |x| + |z| + |(x-y)+(y-z)| \\ \quad \quad \geq |x| + |z| + |x-z| = d(x,z)$$