two questions on general topology

Your answers are correct, but the reason that you give for the first problem could be stated better. The fact that the irrationals are dense in $\Bbb R$ is irrelevant: what matters is that the rationals are dense. You know that a connected subset of $\Bbb R$ must be an interval, but every non-trivial interval contains a non-empty open interval and therefore a rational number, so the only connected sets consisting entirely of irrational numbers are trivial intervals of the form $[x,x]=\{x\}$ for irrational $x$.

Jonas Meyer makes the good point that many of us consider the empty set to be connected and would therefore say that the correct answer is that $|X|\le 1$. However, this isn’t an available choice, so it’s clear that $|X|=1$ is the desired answer.


Both trains of thought are correct (we'll assume $A$ is nonempty to avoid Jonas's point, since 0 isn't one of the choices anyway). Formally for (1), we can use that any connected set of real numbers enjoys the intermediate value property: if $x,y\in A$ and $x < z < y$, then $x \in A$. Now if $|A|>1$ then there exist $x < y$ in $A$. Then there is a rational number $r$ with $x < r < y$ by density of $\mathbb{Q}$ in $\mathbb{R}$, but $A$ contains only irrational numbers, contradiction. So $|A|\leq 1$, and since $A$ is assumed nonempty $|A|=1$.