The definition of a metric and the triangle inequality Let $f:X\times X \to [0,\infty)$ and 
1) $f(x,y)=f(y,x)$ 
2) $f(x,y)=0 \Leftrightarrow x=y$
(Note that we remove the triangle inequality from the definition of a metric.) My question is why the triangle inequality is necessary in the definition of a metric? Why it is useful?
 A: The notion of a metric is supposed to capture the main features of the everyday idea of distance between two points. The most important parts of this idea are that 


*

*a point is at zero distance from itself;  

*distinct points are a positive distance apart;  

*the distance from a point $x$ to a point $y$ is the same as the distance from $y$ to $x$; and  

*the distance directly from a point $x$ to a point $y$ is never longer than the distance from $x$ to $y$ by way of some third point $z$.


The first two of these correspond to your $(2)$, and the third is your $(1)$; the fourth is the triangle inequality. Why pick these particular features? Basically because they turn out to be the most useful. They allow a great many arguments (e.g., $\epsilon$-$\delta$ proofs) from elementary analysis to be generalized to much more complicated and abstract settings. 
It is possible to study functions that satisfy only some of these conditions. For instance, if we drop my second condition we get what are called pseudometrics, which turn out to be quite useful. What you’ve defined is called a semimetric; people have studied them, but in general they aren’t very useful. 
