Is there a rationality-preserving order isomorphism between $\mathbb{Q}$ and two disjoint open intervals? I have a homework question in a intro logic course, part of which requires me to

Find an order preserving isomorphism between $\mathbb{Q}$ and $\mathbb{Q} \cap ((0,1) \cup (2,3))$.

So, I need an isomorphism between $\mathbb{Q}$ and two open intervals that preserves both order and rationality. 
I am familiar with how to do this for any single open interval. For example,
$$f(x) = \frac{x}{1+|x|}$$
maps $\mathbb{Q}$ bijectively on to $(-1,1)$, preserving order and rationality. From this I can compose $f$ with some other simple bijection to map $\mathbb{Q}$ to any open interval.
I figure it is convenient to begin again by apply the function $f$ so that the task boils down to finding a map from $(-1,1)$ on to $\mathbb{Q} \cap ((0,1) \cup (2,3))$. My initial thought was that if I attempted to split $(-1,1)$ at a rational number $q \in (-1,1)$, then I would have the dilemma of where to map $q$ to preserve the order. So then I figured that I needed to split $\mathbb{Q}$ at an irrational number $\alpha \in (-1,1)$. This way I don't need to map $\alpha$ to anything, and the order will be preserved automatically, provided I can find a map that send $(-1,\alpha)$ to $(0,1)$ and $(\alpha, 1)$ to $(2,3)$. However I cannot find a way to do this that preserves rationality.
I would guess what I am trying to do is impossible, but Cantor's theorem on unbounded countable dense linear orders guarantees that some isomorphism exists. (If I am interpreting it correctly).
Is there a way to get around the irrationality problem? Or am I way off?
 A: While a pain, constructing something inductively should be straightforward. Observe, for example,
$$ (-\infty, \sqrt{2}) = (-\infty, 0] \cup (0, 1] \cup (1, 1.4] \cup (1.4, 1.41] \cup \ldots $$
A: This simple-minded method seems to me to work fine to me, maybe I’m missing something. First map $\mathbb Q$ to an open interval like $\langle0,1\rangle$ as by your method. Then use the function $x\mapsto 1/(2x^2-1)$. You see that it takes the interval $\langle0,1/\sqrt2\rangle$ decreasingly onto $\langle-\infty,-1\rangle$ and $\langle1/\sqrt2,1\rangle$ similarly decreasingly onto $\langle1,\infty\rangle$ But your method once more can take an infinity-ended open interval of rational numbers to a finite open interval of rational numbers, so you can cook up a final result whose image (range) is $\langle0,1\rangle\cup\langle2,3\rangle$.
EDIT: As @BrianM.Scott points out in a comment, this map is not onto. If I had been thinking a bit more abstractly, I would have realized that a degree-two rational function from an interval in $\mathbb 
Q$ to an interval can’t possibly be onto, any more than $x\mapsto x^2$ maps $\langle0,1\rangle$ onto itself when restricted to rational values of domain and codomain.
So I think a method like that of @Hurkyl has to be the only way to do what we want.
