If $X$ is homeomorphic to dense subspace $Y\subseteq X$, then $X=Y$ It is a basic fact of topology that if $X$ is a topological space and $Y\subseteq X$ is homeomorphic to $X$, it does not need to occur that $X=Y$ (for example, $X=\mathbb{R}$, $Y=(0,1)$). My question is, if I add the requirement that $Y$ is dense in $X$. Is this still the case? Or is the following true?
If $X$ is homeomorphic to a dense subspace $Y\subseteq X$, then $X=Y$.
 A: It's not true.  Consider $Y=\mathbb N$ and $X=\mathbb Z$, both with the trivial (indiscrete) topology.
Then $Y$ is dense in $X$ (every non-empty subset is dense in this topology) and homeomorphic to $X$
(there is a bijection between $Y$ and $X$, and every map to an indiscrete space is continuous),
but clearly $X\ne Y$.
A: For a more interesting example, let $X=\Bbb Q$ with the usual topology, and let
$$Y=\left\{\frac{m}{2^n}\in\Bbb Q:m,n\in\Bbb Z\text{ and }n\ge 0\right\}$$
be the set of dyadic rationals. Then $Y$ is a proper subset of $X$ that is both dense in $X$ and homeomorphic to $X$.
A: Counterexample:
$$\mathbb{Q}\backslash \{0\} \subset \mathbb{Q}$$
$\bf{Added:}$  It turns out that if $A$, $B$ are dense, countable subsets of $\mathbb{R}$, then there exists a homeomorphism $f\colon \mathbb{R}\to \mathbb{R}$, such that $f(A)=B$.
Perhaps an explicit example is best. Consider $A=\mathbb{Q}$, and $B = \mathbb{Q}^3\subset \mathbb{Q}$. The map $x\mapsto x^3$ is a homeomorphism of $\mathbb{R}$ taking  $A$ to $B$.
A: Let $X=\mathbb{Z}$ and $Y=\mathbb{N}$ then $\mathbb{N}\subset \mathbb{Z} $, and define trivial topology $T$=$\{\emptyset,\mathbb{Z} \}$  on $\mathbb{Z}$. Let $x \in \mathbb{Z}$ , then $\forall$ open neighbourhood of $x$ there is non empty intersection with $\mathbb{N}$. Therefore $\mathbb{N}$ dense in $\mathbb{Z}$.
Also let define function $f :\mathbb{N}$ $\rightarrow$ $\mathbb{Z}$ as follows
$f(n) =\begin{cases}
-(n-2)/2,  & \text{if $n$ is even} \\
(n+1)/2, & \text{if $n$ is odd}
\end{cases}$
Therefore $f$ is homeomorphic function. So in here clearly $\mathbb{Z}$ $\neq$ $\mathbb{N}$
