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$.

Let $X$ be a set and $d: X \times X \to X$ be a function such that $$d(a,b)=0\text{ if and only if}\;\; a=b,\text{ and}\tag{1}$$ $$d(a,b) ≤ d(z,a)+d(z,b)\forall a,b,z \in X.\tag{2}$$ 
There's additional criterion that needs to be met for a function $d$ to be a metric on $X$: 


*

*You must have that $d(a, b) = d(b,a)$ for all $a, b \in X$ (symmetry).You can use the two properties you have been given to prove this.  $d(a,b)\leq d(b,a)+d(b,b)= d(b, a) + 0 = d(b,a)$ and vice versa, hence we get equality.

*Having proven symmetry, you will then have that  $d(a,b) \leq d(z,a) + d(z, b) \iff d(a, b) \leq d(a, z) + d(z, b)$.

*Finally, using the property immediately above, along with the $(1)$, you can establish that for all $a, b\in X$ such that $a\neq b$, we must have $d(a, b) > 0$. 
Then you are done.

