I am trying to show that the rational interval $ S= \{x \in \mathbb Q : a \leq x \leq b\} $ is disconnected in the metric space $(X,d)$ where $X=\mathbb R$ and $d$ is the standard metric ( $ d(x,y)=|x-y| \; \forall \; x,y \in \mathbb R$ )
The definition of disconnected I would like to use is: a metric space $(X,d)$ is disconnected if there are non-empty, open, disjoint sets $A, B$ such that $X=A \cup B$.
If $a,b \notin \mathbb Q$ I think I have shown the above by what follows.
Any rational interval contains an irrational number (assume known). Let $c$ be an irrational number and $a<c<b$. Let $A=\{x\in \mathbb Q : a<x<c \}$ and $B=\{x\in \mathbb Q : c<x<b \}$. $A$ and $B$ are disjoint and open. $A$ and $B$ are non-empty as every interval contains a rational number (assume known). As $c \notin \mathbb Q$ $S=A \cup B$ and so S is disconnected.
If either $a$ or $b$ do belong to $\mathbb Q$ then I don't know how to construct the sets $A$ and $B$ so that they are both open, disjoint and their union is $S$. As if for example if $A=\{x\in \mathbb Q : a\leq x<c \}$ then this is neither open nor closed I think.
How could this problem be solved?