Construct a complete metric on $(0,1)$ Can anyone construct a complete metric on $(0,1)$ which induces the usual subspace topology on $(0,1)$ ?
 A: Define the function $f$ on $X=(0,1)$ by 
$$f(x)=\dfrac{2x-1}{x(1-x)}=\dfrac1{1-x}-\dfrac1x,
$$
for every $x$ in $X$, and use $f$ to define a metric $d$ on $X$ by $$d(x,y)=|f(x)-f(y)|,$$ for every $x$ and $y$ in $X$. Then the metric space $(X,d)$ is complete, and its topology is the usual one.
Every function $f:X\to\mathbb R$ would do as soon as $f$ is continuous, increasing, and has limits $-\infty$ at $0$ and $+\infty$ at $1$.
A: The map
$$
f:(0,1)\to\mathbb{R}:x\mapsto\tan\pi\left(x-\frac{1}{2}\right)
$$
is a bijection which allows you to define the metric
$$
d(x,y)=|f(x)-f(y)|
$$
which makes $((0,1),d)$ complete. Since $f$ maps intervals to intervals then both topologies are equivalent.
A: More generally, if $O$ is an open subspace of a Polish space $X$, then $O$ is a Polish space. An argument is to consider the inclusion $$\left\{ \begin{array}{ccc} O & \to & X \times \mathbb{R} \\ x & \mapsto & \left( x, \frac{1}{d(x,X \backslash O)} \right) \end{array} \right..$$
Then $O$ is closed in $X \times \mathbb{R}$ (roughly speaking, $\partial O$ is "pushed to the infinity" in $X \times \mathbb{R}$) and $X \times \mathbb{R}$ is completely metrizable using the distance $$((x_1,y_1),(x_2,y_2)) \mapsto \max (d(x_1,x_2), |y_1-y_2|).$$
For the specific example $X= \mathbb{R}$ and $O= (0,1)$, it gives the distance $$(x,y) \mapsto \max \left( |x-y| , \left| \frac{1}{\min(x,1-x)}- \frac{1}{\min(y,1-y)} \right| \right).$$
