I'm trying to prove that an open subspace of a topologically complete space is topologically complete. I follow the hint in the book. We defined $\phi : U \rightarrow R$ by the equation
$$\phi(x) := \frac 1{d(x, X-U)}$$
Imbed $U$ in $X \times R$ by setting $$f(x):= \big(x,\phi(x)\big)$$ I can prove that $f(x)$ homeomorphism. So the things remains is to prove that $f(U)$ is closed and $X \times R$ is topologically complete. But I can't find any hint to prove it.
Can someone help me finish my proof. Thanks so much

First, show that $(X \times \mathbb{R},\delta)$ is complete where $\delta((x,r),(y,s))=\max(d(x,y),|r-s|)$.
Then, let $(f(x_n))$ be a sequence in $f(U)$ converging to some $y \in X \times \mathbb{R}$. In particular, $(\phi(x_n))$ is bounded so $d(x_n,\partial U)>\epsilon$ for some $\epsilon>0$ (because $\phi(x) \to + \infty$ as $x \to \partial U$). Therefore, $x_n \in W$ for some closed subset $W \subset U$, hence $y \in \overline{f(W)} = f(W) \subset f(U)$ because $f$ is a homeomorphism. Thus $U \times \mathbb{R}$ is closed in $X \times \mathbb{R}$.