Criteria for metric on a set Let $X$ be a set and $d: X \times X \to X$ be a function such that $d(a,b)=0$ if and only if $a=b$. 
Suppose further that $d(a,b) ≤ d(z,a)+d(z,b)$ for all $a,b,z \in X$. 
Show that $d$ is a metric on $X$.

The first condition of a metric is $d(a,b)\geq 0$ with equality if and only if $a=b$. Obviously that latter portion is satisfied by hypothesis. To show it is greater than zero otherwise, just observe $0=d(b,b)<d(a,b)+d(a,b)$. Thus, the first condition is satisfied.
Next, we want to show $d(a,b)=d(b,a)$. This is clear, though, since $d(a,b)\leq d(b,a)+d(b,b)=d(b,a)$ and vice versa, hence we get equality.
Finally, your last hypothesis is precisely the triangle inequality. Hence, $d$ is a metric.
