TITLE: Metric Space (Elementary Analysis)
QUESTION [5 upvotes]: Let $d: X \times X \to \Bbb R$ is a function satisfying all properties of a metric space but $d(x,y)=0 \implies  x = y$.
If we define $\sim$ on $X$ by $x\sim y \iff d(x,y) = 0$,
prove that $D([x], [y]) = d(x,y)$ where $[x] = \{z \in X \mid z\sim x\}$ is well-defined on equivalence classes and makes the set of equivalence classes into a metric space.
Some helps please!!
(I showed that $\sim$ is equivalence relation)
Thank you! 
+++
I followed your advice and just solved this problem. Could you tell me if there is any weakness or error in my proof?

REPLY [4 votes]: In essence you're identifying all the "indistiguishable" points, that is, pairs such that $x\neq y$ yet $d(x,y)=0$ into one point $\bar x=\{y:d(x,y)=0\}$. 
You ought to prove two things:
$(1)$ The new metric $d(\bar x,\bar y):=d(x,y)$ where we choose $x\in\bar x,y\in \bar y$ is "well-defined", meaning that the output does not depend on the representative we take in $\bar x,\bar y $ to feed into $d(x,y)$. Thus, prove that $x\sim x'$ and $y\sim y'\implies d(x,y)=d(x',y')$.
$(2)$ This alleged metric is indeed one.
Hint Assume $d(x,x')=d(y,y')=0$. $$\begin{align}d(x,y)&\leq d(x,x')+d(x',y')+d(y',y)\\d(x,y)&\leq \;\;\;\;0\;\;\;\;+\;\;\;\;0\;\;\;\;\;+d(y',y)\\d(x,y)&\leq d(x',y')\end{align}$$
It remains to show under the same assumption that $d(x,y)\geq d(x',y')$.

When working with say the space of all square Lebesgue integrable functions over some interval, $\mathscr L^2(I)$, one usually uses the above. Concretely, one defines $f\simeq g\iff f=g \text{ a.e. on } I$ to work with a metric space instead of a semi-metric space.

REPLY [2 votes]: You're well on your way! You've shown that $\sim$ is an equivalence relation. Now, you still need to prove that $D$ is well-defined (that our choice of representatives from the equivalence classes doesn't matter).
By definition of $D$, it is straightforward to prove that $D$ has all the metric properties that $d$ does, so the only thing left to show is that $D([x],[y])=0$ implies that $[x]=[y],$ but again this follows fairly directly from the definition of $D$ and $\sim$