There are two things to address here:
1) Why are the singletons $\{(0,1)\}$ and $\{(0,0)\}$ components?
2) Why is there no closed and open subset of $X$ containing one point and not the other?
For the first question, recall that a component of $X$ is defined as a maximal connected subspace. So we need to show that the only connected subspace of $X$ containing, say, $(0,0)$, is the singleton set. That is, we need to show that a connected subspace $C \subset X$ containing $(0,0)$ must be the singleton. It should be readily apparent that $C$ cannot contain any point of $A_n$ for any $n$, because those points can be separated by a vertical line with irrational $x$-coordinate, and it immediately follows that it can't contain $(0,1)$ either.
As for the second question, any closed and open subset of $X$ must contain either all of or none of $A_n$, for each $n \in \mathbb{N}$. This is because $A_n$ is connected. So if $C \subset X$ is both open and closed, and contains $(0,0)$, then it contains $A_n$ for $n$ sufficiently large, ie, close to $(0,0)$ and $(0,1)$. Therefore $(0,1)$ is a limit point of $C$.