This is just a quick question, as a follow-up to Chris Eagle's answer on this post.
In it, he considered $X=\left \{ \frac{1}{2n} : n \in \mathbb{N} \right\}$ and $Y=\left \{ \frac{1}{2n+1} : n \in \mathbb{N} \right \}.$ And being a requirement to answer that post's question, how does it follow that these are closed subsets of $(0,1)$? It seems that the two would be dense in $(0,1)$ rather than be equal to their closure.
I think I'm missing something obvious or I misinterpreted the OP's question.