The only subspace of $\mathbb{R}$ that is homeomorphic to $\mathbb{R}$ and complete (with the restricted metric) is $\mathbb{R}$ The only subspace of $\mathbb{R}$ that is homeomorphic to $\mathbb{R}$ and complete (with the restricted metric) is $\mathbb{R}$.
My work-
Let $A$ be a subspace of $\mathbb{R}$ such that $A$ is homeomorphic to $\mathbb{R}$ and is complete. Let, $f : \mathbb{R}\to A$ be a homeomorphism. Since $A$ is complete, so it is closed in $\mathbb{R}$ which implies $f(A)$ is closed in $A$. Therefore, $f(A)$ is complete. Then, I want to prove that $f(A)=A$. I am stuck here. If I can prove this then it will easily show that $A^c=\emptyset$ as $f$ is bijective.
Thank you!
 A: I don't know how to help continue your proof, but here's a different method:
Let $A$ be such a subspace. Since $\mathbb R$ is connected, so is $A$. Therefore $A$ is an interval of $\mathbb R$. To conclude, it's enough to show that $A$ is unbounded.
Assume that $A$ is bounded above. As a subset of $\mathbb R$, it has a least upper bound $s:=\sup A$. There does exist a sequence of $A$ that converges to $s$. Such a sequence would be a Cauchy sequence of $A$ and, if $s\notin A$, then that Cauchy sequence would have no limit in $A$, contradicting its completeness. Therefore $s\in A$ which shows that $A$ is an interval of the form $[y,s]$ or $(y,s]$ (in the second case, $y$ may be $-\infty$). In both cases, $A\backslash\{s\}$ is a connected space, while removing a point from $\mathbb R$ disconnects it. Therefore $A$ is not bounded above. Similarly, $A$ is not bounded below.
Edit: As 伽罗瓦 pointed out in comments, one can make the argument shorter: $A$ being complete, it is closed. Therefore $\sup A,\inf A\in A$.
When everything's rightly reformulated, one gets a nice compact proof as in egreg's answer.
A: If $A$, with the induced metric, is a complete subspace of $\mathbb{R}$, then it is closed. Since $A$ is by assumption is homeomorphic to $\mathbb{R}$, it is an interval. A closed interval is of one of the following types:


*

*$[a,b]$

*$(-\infty,b]$

*$[a,\infty)$

*$(-\infty,\infty)$
Types 1, 2 and 3 are not homeomorphic to $\mathbb{R}$, because removing a point from $\mathbb{R}$ leaves a disconnected set.
A: Let $d$ be the usual metric on $\mathbb{R}$. Let $f:\mathbb{R}\rightarrow X\subseteq\mathbb{R}$
be a homeomorphism such that $(X,d)$ is a complete metric space.
We go to show that $X=\mathbb{R}$.
Recall that connectedness is preserved by continuous map, so $X=f[\mathbb{R}]$
is connected and hence $X$ must be an interval (Well-known fact:
A subspace of $\mathbb{R}$ is connected iff it is an interval.).
Denote $X=\langle a,b\rangle$, where $\langle$ may be $($ or $[$,
$\rangle$ may be $)$ or $]$ and $-\infty\leq a\leq b\leq\infty$.
Clearly, by considering cardinality, we must have $a<b$. We go to
prove the following facts:
(a) If $a\in\mathbb{R}$, then $\langle$ must be $[$. For, if $\langle$
is $($, Choose $x_{0}\in(a,b\rangle$. Define $x_{n}=a+\frac{1}{n}(x_{0}-a)$.
Clearly, $(x_{n})$ is a Cauchy sequence in $X$. However $(x_{n})$
does not converge to any point in $X$, contradicting to the completeness
of $(X,d)$.
(b) Similarly, if $b\in\mathbb{R}$, then $\rangle$ must be $]$.
(c) If $a\in\mathbb{R}$, it will lead to a contradiction for the
following reason: Suppose that $a\in\mathbb{R}$ and $X=[a,b\rangle$.
Since $f$ is bijective, there exists $x_{1}\in\mathbb{R}$ such that
$f(x_{1})=a$. Choose $x_{0},x_{2}\in\mathbb{R}$ such that $x_{0}<x_{1}<x_{2}$.
Since $f$ is injective, $f(x_{0})\neq f(x_{1})$ and $f(x_{2})\neq f(x_{1})$.
That is, $f(x_{0})>a$ and $f(x_{2})>a$. Choose $l$ such that $a<l<\min(f(x_{1}),f(x_{2}))$.
Note that $l\in X$ because $X$ is an interval. By intermediate value
theorem (by regarding $f:\mathbb{R}\rightarrow\mathbb{R}$ as a continuous
function), there exists $\xi\in(x_{0},x_{1})$ and $\eta\in(x_{1},x_{2})$
such that $f(\xi)=l$ and $f(\eta)=l$. This contradicts to the fact
that $f$ is injective.
(c) If $b\in\mathbb{R}$, it will lead to a contradiction for similar
reason.
(d) By the above discussion, we must have $a=-\infty$ and $b=\infty$.
That is, $X=\mathbb{R}$.
