I encountered this question in Abbott's Understanding Analysis. The problem asks to construct a nonempty perfect set with no rationals. It starts with enumerating the rationals $\mathbb{Q}=\{r_1,r_2,...\}$. At first we start with an open set $O:=\bigcup_1^\infty V_{\epsilon_n}(r_n)$ where $\epsilon_n:=1/2^n$ and $V_{\epsilon_n}(r_n)$ is open neighborhood of $r_n$ with radius $\epsilon_n$. Then $F:=O^c$ is obviously closed and nonempty (since lengths of the open intervals add up to 2) and $F$ obviously contains only irrationals also $F$ does not contain any open intervals since it does not contain any rational so $F$ is totally disconnected as well. But it is not possible to know that $F$ is perfect, since it may have isolated points. How do I modify the above construction to make $F$ as a perfect set??
Edit: I have seen similar questions here but with different constructions of different sets. Here the question asks for a very specific modification of a given construction.