An explicit bijection between $\mathbb{Q}^+$ and $\mathbb{Q}$? I was trying to show that $\vert \mathbb{Q}^+\vert=\vert \mathbb{Q}\vert$. An injection is so easy to find, but I’m having amhard time finding a surjection. Also, I don’t think there’s a similar question on stackexchange now...
 A: For simplicity, we will define $\mathbb{Q}^+:=\{x\in \mathbb{Q}:x\ge 0\}$.
One explicit bijection between $\mathbb{R}$ and $\mathbb{R}^+$ is:
$$f(q)=\begin{cases}
2\lfloor q\rfloor+\text{frac}(q)&\lfloor q\rfloor\ge0\\
-2\lfloor q\rfloor -1+\text{frac}(q)&\lfloor q\rfloor<0\\
\end{cases}$$
This function, if restricted to $\mathbb{Q}$, defines a bijection between $\mathbb{Q}$ and $\mathbb{Q}^+$ and if restricted to $\mathbb{Z}$ a bijection $\mathbb{Z}\leftrightarrow \mathbb{N}$.
More generally, given a bijection $g:\mathbb{Z}\leftrightarrow \mathbb{N}$, we can extend it to $\hat{g}:\mathbb{R}\leftrightarrow\mathbb{R}^+$ by
$$\hat{g}(x)=g(\lfloor x \rfloor )+\text{frac}(x)
$$ and this extension induces a bijection $\hat{g}_{|\mathbb{Q}}:\mathbb{Q}\leftrightarrow \mathbb{Q}^+$
Note: however  to prove $|\mathbb{Q}|=|\mathbb{Q}^+|$, you do not need to  find an explicit bijection. In fact, thanks to the Schroder-Bernstein theorem it suffices to show an injection $\mathbb{Q}^+\to \mathbb{Q}$ and viceversa.
A: I don't know a neat closed form for such a bijection. However, if one has a bijection between $\mathbb N = \{1,2,3,\ldots\}$ and $\mathbb Q$ and another bijection between $\mathbb N$ and $\mathbb Q^+,$ then one can let the $n$ number in one list correspond to the $n$ number in the other list, and that's a bijection between $\mathbb Q$ and $\mathbb Q^+.$
And if one has a bijection from $\mathbb N$ to $\mathbb Q,$ then one can omit the terms that are not in $\mathbb Q^+$ to get a bijection from $\mathbb N$ to $\mathbb Q^+.$
Thus once we have a bijection from $\mathbb N$ to $\mathbb Q,$ we're there.
Look at $\mathbb Z\times\mathbb N.$ Consider the set of fractions $$S_\ell=\left\{ \frac k n : (k,n)\in\mathbb Z\times\mathbb N\ \&\ \max\{|k|,n\}= \ell \right\}.$$ For example, $$S_5 = \left\{ \frac 5 1, \frac 5 2, \frac 5 3, \frac 5 4, \frac 5 5, \frac 4 5, \frac 3 5, \frac 2 5, \frac 1 5, \frac 0 5, \frac{-1}5, \frac{-2}5, \frac{-3}5, \frac{-4}5, \frac{-5}5, \frac{-5}4, \frac{-5}3, \frac{-5}2, \frac{-5}1 \right\}.$$
Discard all members that are not in lowest terms (in this case only $\pm5/5$ and $0/5$), getting a set which let us call $T_\ell.$
Now observe that $\mathbb Q=\bigcup\limits_{\ell=1}^\infty T_\ell.$ It should quickly become clear that there is a bijection from $\mathbb N$ into this union, even if there is no neat algebraic formula for it.
