Let $f,g:\mathbb{R}^2\times\mathbb{R}^2\rightarrow \mathbb{R}$ with $$f(x,y)=\frac{|x_1-y_1|}{1+|x_1-y_1|}+\frac{|x_2-y_2|}{1+|x_2-y_2|}$$ and $$g(x,y)=\begin{cases}0 & x=y \\ 1& x\neq y\end{cases}$$ I want to check if these function satisfies the triangle inequality, i.e. if $$f(x, y) \leq f(x, z) + f(z, y) \ \ \text{ and } \ \ g(x, y) \leq g(x, z) + g(z, y) , \ \ \ \forall x, y, z$$
For the function $f$ we have that $$f(x, z) + f(z, y)=\frac{|x_1-z_1|}{1+|x_1-z_1|}+\frac{|x_2-z_2|}{1+|x_2-z_2|}+\frac{|z_1-y_1|}{1+|z_1-y_1|}+\frac{|z_2-y_2|}{1+|z_2-y_2|}$$ I think that the function doesn't satisfy that inequality because we have the absolute value also in the denominator, but how could we show it?
For the function $g$ we have that $$g(x, z) + g(z, y) =\begin{cases}0 & x=z \\ 1& x\neq z\end{cases}+\begin{cases}0 & z=y \\ 1& z\neq y\end{cases}=\begin{cases}0 & x=z\land z=y \\ 1& x= z\land z\ne y \\ 1 & x\neq z\land z=y \\ 2& x\neq z\land z\neq y\end{cases}\geq g(x,y)$$ Is this correct? Or could we show wit hmore details the last step?