As a general topologist, I can see standard ideas to build a proof, although I think it is too complicated for an exam question.
For the convenience, given any countable dense subsets $D_1$ and $D_2$ of $[0,1]$, both containing $\{0,1\}$, we shall construct a homeomorphism $h$ of the closed segment $[0,1]$ such that $h(D_1) = D_2$. Then, since $h(\{0,1\})=\{0,1\}$, the restriction $h|(0,1)$ of $h$ onto the open interval $(0,1)$ is the required homomorphism.
First, we use a standard trick (which is called "back-and-forth", if I am not mistaken) to construct a strictly increasing map $h|D_1$. For each $k\in\{1,2\}$ let $\{d_k^n:n\in\mathbb N\}$ be any enumeration of the set $D_k$ such that $d_k^1=0$ and $d_k^2=1$. Moreover, for each natural $i$, we put $D_k^i=\{d_k^1,\dots,d_k^i\}$ and construct a strictly increasing map $h|E_i$ such that $E_i\supset D_1^i$ and $h(E_i)\supset D_1^i$. First put $h(0)=0$ and $h(1)=1$, that is $h(d_1^1)=d_2^1$, $h(d_1^2)=d_2^2$, and $h(D_1^2)=D_2^2$. Now we shall proceed by induction on $i$ as follows. Suppose that the set $E_i$ is already constructed. First, if $d_1^{i+1}\in E_i$ then put $E_{i+1}=E_i$. Otherwise put $E_{i+1}=E_i\cup \{d_1^{i+1}\}$ and since the set $D_2$ is dense in $[0,1]$ we can pick as $h(d_1^{i+1})$ some point of $D_2$ such that the map $h|E_{i+1}$ is strictly increasing. Next, if $d_2^{i+1}\in h(E_{i+1})$ then we keep $E_{i+1}$. Otherwise, since the set $D_2$ is dense in $[0,1]$, we can add to $E_{i+1}$ some point $d_1\in D_1$ ensuring that $h(d_1)=d_2^{i+1}$ and the map $h|E_{i+1}$ is strictly increasing. The inductive construction provides a strictly increasing bijection $h|D_1$ between $D_1$ and $D_2$.
Now we extend the map $h|D_1$ to $[0,1]$ by putting $$h(x)=\sup\{h(d):d\in D_1\cap [0,x]\}$$ for each $x\in [0,1]$. Since the map $h|D_1$ is strictly increasing and the set $D_1$ is dense in $[0,1]$, the map $h$ is strictly increasing too.
We claim that the map $h$ is continuous. Indeed, let $x\in (0,1)$ be any point and $\varepsilon>0$ be any number. Since the set $D_2$ is dense in $(0,1)$, there exist numbers $d_2',d_2''\in D_2$ such that $$h(d)-\varepsilon<d_2'<h(x)<d_2''<h(d)+\varepsilon.$$ Since the map $h|D_1$ is a bijection between $D_1$ and $D_2$, there exist $d_1',d_1''\in D_1$ such that $h(d_1')=d_2'$ and $h(d_1'')=d_2''$.
Since the map $h$ is strictly increasing, $d_1'<x<d_1''$. Moreover, for each $x'\in (d_1',d_1'')$ we have $$h(x')\in (h(d_1'),h(d_1''))=(d_2',d_2''),$$ so $|h(x')-h(x)|<\varepsilon$. Thus $h$ is continuous at $d$. Similarly we can show that $h$ is continuous at $0$ and $1$.
It is well known (see, for instance, this thread) that the space $[0,1]$ is compact. Since it is also Hausdorff, the inverse $h^{-1}$ of the
continuous bijection $h$ is continuous too, so $h$ is a homeomorphism.