Let $(X,d)$ a metric space and $\mathcal{R}$ an equivalence relation such that satisfies :
For all $x \in X : [x]$ is closed.
If $[x]\neq [y] $ then for all $a \in [x] : d(a,[y])=d([x],[y])$
Prove that the function : $$ f: \frac{X}{\mathcal{R}} \times \frac{X}{\mathcal{R}} \longrightarrow \mathbb{R} $$ defined by : $f([x],[y])=d([x],[y])$ is a metric in $\frac{X}{\mathcal{R}}$.
I have some problems to prove the triangle inequality. Thanks for read!