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?
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 $$