A function $d: \mathbb{R}\times\mathbb{R}\to\mathbb{R}$ is a metric on $\mathbb{R}$ iff all of the following holds:
$d(x,y)\geq0 \;\forall x,y $
$d(x,y)=0 \iff x=y$
$d(x,y)=d(y,x)$
Triangle inequaliy
The exercise asks us to give one example of function that satisfies all of the conditions above but one (for each condition).
I was successfull on 2.: $d(x,y)=\vert x-y\vert +1$ do satisfies 1,3,4 but not 2., right?
On the others I got stuck, I tried floor and ceil things, sums, multiplications... nothing did work.
Could you help me? (I'm sorry if it is duplicated, I couldn't find something like this)
Edit: I could do 4. too, but it isn't a "beautiful" example I think: $d(x,y)=\begin{cases}\vert x-y\vert-5, \mbox{ if }\vert x-y\vert >5 \\\vert x-y\vert, \mbox{ otherwise}\end{cases}$, then we have $d(1,15)>d(1,7)+d(7,15)$ for example.