Suppose $O \subset X$ is open in a complete metric space $(X,d)$. Define the distance $f(x) = d(x, X\setminus O)$
Then my questions are:
(a) Prove that $f$ is a continuous function and $>0$ on $O$.
(b) Prove that the distnce $d'(x,y) = d(x,y) + \left| \frac{1}{f(x)} + \frac{1}{f(y)} \right |$ is a complete metric on $O$ that is equivalent to the restriction of the metric $d$ on $O$.
For b) consider a Cauchy sequence $(x_n)$ for $d'$ it is a $d$-Cauchy sequence, since $X$ is complete, there exists $x\in X$ such that $lim_nx_n=x$, suppose that $x\in X-O$, for every integer $N$, there exists $p_N$ such that $m>p_N$ implies that $d(x,x_m)<1/N$ we deduce that $d(x_m,X-O)<1/N$ and $f(x_m)<1/N$, for every $p,m>p_N$, $d(x_p,x_m)\geq |{1\over{f(x_p)}}+{1\over{f(x_m)}}|\geq 2N$, contradiction since $(x_n)$ is a Cauchy sequence, we deduce that $x\in O$ and $(O,d')$ is complete.