Can we give a metric $d$ on $\mathbb R$ such that the closure of $(0,1)$ with respect to $d$ is $[0,1]\cup\{2\}$?
I think the answer is no. For $x\in(0,1)$, there are disjoint open sets $U_x$ and $U_2$ (in the metric $d$) containing $x$ and $2$ respectively. That is for all $x\in(0,1),d(x,2)\gt0$ and $\{2\}$ is closed, so $\overline{(0,1)}\ne[0,1]\cup\{2\}$ in any metric $d$.
Is my argument correct?
