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

This must be the discrete metric.
1) The first condition follows by definition that d(a,b)=0 iff a=b;
2) Symmetry: this is trivial, because if a=b you have d(a,b)=0 and b=a gives you d(b,a)=0;
3) The triangle inequality: from the symmetry you can write d(z,a)=d(a,z).
Consider two cases:
 - if a=b, clear
 - if a is not equal to b, then either a not equal to z or z not equal to b. There you have $1\leqslant 1$ or $1\leqslant 2$.
