I'm showing that the connected components of $\mathbb{Q}$ are sets containing a single point. Let $A \subset \mathbb{Q}$ have at least two points in it, say $p$ and $q$ with $p \neq q$ and assume without loss of generality that $p < q$. Then there exists some irrational number $x$ such that $p < x < q$. Now write $$ A = (A \cap (-\infty,x)) \cup (A \cap (x, \infty)) =: U \cup V $$ It is true that $A \subset \mathbb{Q}$ and also $A \subset \mathbb{R}$. Also, $(-\infty, x)$ and $(x, \infty)$ are open in $\mathbb{R}$, so $U$ and $V$ are open subsets of $A$ with the subspace topology. Clearly, $U \cap V = \emptyset$ so $A$ is not connected. So for $A$ to be connected, it must be a singleton set.
Now for my question: $(-\infty, x)$ and $(x, \infty)$ are not open in $\mathbb{Q}$ so $U$ and $V$ are not open in the subspace topology when everything is considered as a subset of $\mathbb{Q}$. Is this not a problem for the proof? My definition for $A$ being connected is that it cannot be expressed as the disjoint union of two disjoint non-empty open sets. In the case of $A$ being connected/disconnected, the open sets of $A$ in question are $U$ and $V$. Does it not matter what we considered $A$ itself to be a subset of when using the subspace topology in the proof?
Many thanks for any help.
The topology of $\mathbb{Q}$ is the subspace topology induced from $\mathbb{R}$ and, for instance, $(x, \infty) \cap \mathbb{Q}$ is open in $\mathbb{Q}$, so everything is fine. You can write $(x, \infty) \cap A$ as $(x, \infty) \cap \mathbb{Q} \cap A$. When taking subspace topologies, you can easily check that it makes no difference if you take it in two steps $(\mathbb{R} \to \mathbb{Q}, \mathbb{Q} \to A)$ or in one step $(\mathbb{R} \to A)$. In particular, being connected is a property of the topological space $A$, regardless of what ambient space it is embedded into.