prove that $(0,1)\cap \mathbb{Q}$ is order-isomorphic to $(-\pi,\pi)\cap \mathbb{Q}$ 
it's a part of my set theory HW.
the definition of order-isomorphic in the course:
if $(X,\leq),(Y,\leq)$ are orderly sets than $X \simeq Y$ if there is exist $f:X \to Y$ bijecton surjectiove and if $x_1 , x_2 \in X$ such that $x_2 > x_1$ then $f(x_2) > f(x_1)$
i saw that question:
Prove that $(0 ,1)\cap\mathbb{Q}$ is order-isomorphc to $\mathbb{Q}$: is my proof correct? 
and i didn't figure out how to use that for my question

i tried to prove a lemma: 
for all $a,b\in \mathbb{Q}$ such that $a<b$ and for all $c,d \in \mathbb{Q}$ such that $c<d$:
$(a,b)\cap \mathbb{Q} \simeq (c,d)\cap \mathbb{Q}$

i've proved the lemma


and then define $f:(0,1)\cap \mathbb{Q} \to (-\pi,\pi)\cap \mathbb{Q}$ such that f(0)=0 and to use rational sequences that one is strictly decreasing to $-\pi$ and the other one is strictly decreasing to $0$ and build with that sequences two sequences $a_n,b_n$ such that $a_n <0$ for all $n\in \mathbb{N}$ and $a_n \stackrel{n\to\infty}{\to} -\pi$ and $b_n < \frac{1}{2}$ for all $n\in \mathbb{N}$  and $b_n \stackrel{n\to\infty}{\to} 0$ and define isomorphic functions $f_n : (b_{n+1}, b_n)\cap \mathbb{Q} \to (a_{n+1},a_n)\cap \mathbb{Q}$ for all $n\geq 2$ and for $n=1$ define $f_1: (b_1,\frac{1}{2}) \cap \mathbb{Q} \to (a_1, 0)\cap \mathbb{Q}$ 
and that the Union of all functions its the function i need (of course before that i need to do the same with $(\frac{1}{2},1)$ and $(0,\pi)$) 
but i need to union an infinitely amount of functions and i don't know if it's ok.

i will be glad if someone give me a clue how to continue with my idea or give me an alternative idea to solve that one.
thank you all in advance.
 A: I have found an algorithmic procedure to get the monotonic function you are seeking for: let's call $a_k$ the kth element of $(0,1)\cap \mathbb{Q}$ and $b_k$ that of $(-\pi,\pi)\cap \mathbb{Q}$. Let's call $f$ the function we are building. let $f(a_1)=b_1$. To keep track of elements already assigned consider two sets $A,B$. After each assignement $f(a_i)=b_j$ we add the elements $a_i$ to $A$ and $b_j$ to $B$. So far so good,this was step 1.
Suppose we have completed step $n$, let's define step $n+1$:
if $n$ is odd than choose the first element $b_j$ that is not in $B$.
Choose the first $a_i$ not in $A$ such that if you assign $f(a_i)=b_j$ and update $A$ and $B$, the function $f:A\rightarrow B$ would be monotonic. (you pick the first $a_i$ not in $A$ and check, if you fail you pick the next one that is still not in $A$. This subroutine end after a finit number of substep). Now make the assignment, update $A$ and $B$ and reiterate.
if $n$ is even choose the first element $a_i$ that is not in $A$. Choose the first $b_j$ not in $B$ such that if you assign $f(a_i)=b_j$ and update $A$ and $B$ the function $f:A\rightarrow B$ would be monotonic (here the same as before, you can do that in a finite number of substep). Now make the assignement, update $A$ and $B$ and reiterate.
After each step $n$ you have a function $f:A\rightarrow B$. Let now define the total function $F:(0,1)\cap \mathbb{Q}\rightarrow(-\pi,\pi)\cap \mathbb{Q}$: for each $a_k\in(0,1)\cap \mathbb{Q}$ let $n$ be the step in which you have made the assignment $f(a_k)=b_j$, then define $F(a_k)=b_j$.
By the way this proves also the theorem stated in the comment
