Are these subsets of $\mathbb{R}$ homeomorphic? Consider the following subspaces of $\mathbb{R}$ with the usual topology:
$$X = (0, 1) \cup \{2\} \cup (3, 4) \cup \{5\} \cup \cdots \cup (3n, 3n + 1) \cup \{3n + 2\} \cup\cdots$$
$$Y = (0, 1] \cup (3, 4) \cup \{5\} \cup\cdots\cup (3n, 3n + 1) \cup \{3n + 2\} \cup\cdots$$
Is $X$ homeomorphic to $Y$ ?
For $X$ to be homeomorphic to $Y$, we need to specify a bijective function from $X$ to $Y$ and inverse function from $Y$ to $X$ are continuous. From $(3,4)$ onwards, we can map by identity function. How can I map $(0,1) \cup \{2\}$ to $Y$? $(0,1]$, in usual topology is not open and closed. Can I write $(0,1]$ as $(0,1)\cup\{1\}$, and then map $\{0,1\}$ by identity map and $\{1\}$ to $\{2\}$. Please forgive me if any of what I think is stupid.
 A: Hint: If $f:A\to B$ is a continuous map between topological spaces, and $R$ is a connected component of $A$, then there is a connected component $S$ of $B$ such that $f(R)\subseteq S$.
What does this imply about how homeomorphisms map the connected components of spaces?
Do you see how to apply this to your situation?
A: Hints:


*

*If $f:X\to Y$ is a homeomorphism, then the disconnected singletons of $X$ must map to the disconnected singletons $Y$. Reason being that they are isolated points (open subsets) in $X$ and thus their images are also isolated points in $Y$.

*If $f:X\to Y$ is a homeomorphism, then the image of a connected set is connected. Hence any interval in $X$ must map to an interval in $Y$.

*Conclude with 1. & 2. that if $f:X\to Y$ is a homeomorphism, then an interval of the form $(3n,3n+1)$ is homeomorphic to $(0,1]$ for some $n\in\mathbb{N}$. Take the co-restriction of this homeomorphism to the set $(0,1)$, and try to conclude a contradiction with a connectedness argument.
A: Connectedness is a topology invariant, so $(0,1]$ and $(0,1)\cup\{2\}$ cannot be homeomorphic with the usual topology.
A: Proof 1. Suppose $f:Y\to X$ is a homeomorphism.  The image $f((0,1])$ must be an interval and an infinite set   so it must be a  subset of $(3n,3n+1)$ for some $n.$
But $(0,1]$ has a unique point (i.e., $1$) which, if removed,  leaves a connected set. Since $f((0,1])$ is a homeomorphic image of $(0,1]$ it must also have this property.
So  $f((0,1])=(a,b]$ with $3n\leq a<b<3n+1$, or  $f((0,1])=[b,a)$ with $3n<b<a\leq 3n+1,$ and with $f(1)=b$ in either case.
But in either case  we have $b=f(1)\in Cl_X(X$ \ $f((0,1])$ but $1\not \in Cl_Y(Y$ \ $(0,1]),$ which means $f $ cannot be a homeomorphism.
Proof 2.  If $D\subset \mathbb R$ and $D$ is the homeomorphic image of an open real interval $J$ then $D$ is an open real interval. ($D$ must be connected, so $D$ is an interval. And there cannot exist $d\in D$ such that $D \backslash  \{d\}$ is connected ....else $J$ would have such a point... So $D$ cannot have end-points.)
So if $S$ is an open subset of $\mathbb R$ then any subset of $\mathbb R$ which  is a homeomorphic image of $S$ must be open in  $\mathbb R.$ (Because any open real set is the union of a family of pair-wise disjoint open intervals.)
Suppose $g:X\to Y$ was a homeomorphism . Let $X^i$ and $Y^i$ be the sets of isolated points of $X,Y$ respectively. Then $g(X^i)=Y^i.$ So $g(X$ \ $X^i)=Y$ \ $Y^i .$ But $X$ \ $X^i$ is open in $\mathbb R$ and $Y$ \ $Y^i$ is NOT open in $\mathbb R,$ a contradiction.  
Remark. For the sake of pedantic precision, I include sets of the form $(-\infty,r)$ and $(r,\infty)$ and $\phi$ and $\mathbb R$  among the open real intervals.
