Take the dense subset to be those irrationals whose binary expansion $a_m 2^m+\cdots+a_n2^n$ is finite or periodic for the even powers and infinite and non-periodic for the odd powers. In other words the binary number formed by the coefficients of the even places is rational and the odd places irrational.

Then the map from M from $\mathbb Q\times \mathbb P$ to a dense subset of $\mathbb R$ given by interleaving the binary expansions should work. More formally $M(q,p)=T_e(q)+T_o(p)$ where $T_e(r)$ and $T_o(r)$ are defined by taking a binary expansion of $r$ (you can pick the finite one if there is a choice) and mapping $2^n\rightarrow 2^{2n}$ and $2^n\rightarrow 2^{2n+1}$ respectively. i.e.  

$T_e(11)=T_e(2^0+2^1+2^3)=2^0+2^2+2^6=69$, $T_o(11)=T_e(2^0+2^1+2^3)=2^1+2^3+2^7=138$.

This map is clearly continuous both ways, 1-1 and maps to a dense subset since any real number has an arbitrarily close rational approximation.

There are of course many possible such examples as for any infinite fixed subset S of the integers we can take the dense subset to be those irrational numbers whose binary expansion over $S$ or $\mathbb Z\setminus S$ represents a  rational or irrational respectively.