Take the dense subset to be those irrationals whose binary expansion $a_m 2^m+\cdots+a_n2^n$ is infinite and 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 (in it's infinite form) 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$ where you must pick the infinite periodic one for the rational case (This is necessary as observed by Henrik in the comments) Then in the binary form you map $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$ is infinite and represents a rational or irrational respectively.