For which intervals $[a,b]$ in $\mathbb{R}$ is the intersection $[a,b]\cap Q$ a clopen subset of the metric space $\mathbb{Q}$? 
For which intervals $[a,b]$ in $\mathbb{R}$ is the intersection $[a,b]\cap Q$ a clopen subset of the metric space $\mathbb{Q}$?

My answer is : $[a,b]\cap\mathbb{Q}$ is a clopen subset iff $a,b \in (\mathbb{R}\backslash \mathbb{Q})$, since if $a,b \in \mathbb{Q}$ then $[a,b]\cap \mathbb{Q}$ won't be open.
I got this wrong on a p set.  Can someone correct what I have done wrong?
 A: Well, one thing is that you didn't include the case where $b\lt a$, since in this case the interval is empty, which is both open and closed. 
But also, the logic of your argument isn't quite right, since if $a$ and $b$ are not both irrational, it doesn't mean that they are both rational, but rather it means only that one of them is rational. So you've got to argue that if one of $a$ or $b$ is rational, then the interval is not clopen. But I think it will not be difficult for you to fix that issue. 
A: Your answer is correct if you consider the expression $[a,b]$ ill-formed when $a>b$, but there’s a small flaw in your justification: you’ve said that if $a$ and $b$ are both rational, then $[a,b]\cap\Bbb Q$ is not open (in $\Bbb Q$), which is correct, but to justify your answer you also have to point out that $[a,b]\cap\Bbb Q$ isn’t open in $\Bbb Q$ if even one of $a$ and $b$ is rationa.
If you allow intervals $[a,b]$ with $a>b$, then you must include them as clopen irrespective of whether $a$ or $b$ is rational, since they’re all empty.
