Start with the Cantor pairing function
$$\pi:\Bbb N\times\Bbb N\to\Bbb N:\langle m,n\rangle\mapsto\frac12(m+n)(m+n+1)+n\;.$$
(Note that $\Bbb N=\Bbb Z^+\cup\{0\}$.) Suppose that we can find a bijection $h:\Bbb Z\to\Bbb N$. Then we can define
$$\varphi:\Bbb Z\times\Bbb Z\to\Bbb N\times\Bbb N:\langle m,n\rangle\mapsto\langle h(m),h(n)\rangle\;,$$
and $\pi\circ\varphi:\Bbb Z\times\Bbb Z\to\Bbb N$ will be the desired function.
One natural way to enumerate $\Bbb Z$ is in the order $0,-1,1,-2,2,-3,3,\ldots\;$:
$$\begin{array}{c|cc}
h(n)&0&1&2&3&4&5&6&\ldots\\
n&0&-1&1&-2&2&-3&3&\ldots
\end{array}$$
By inspection the corresponding $h$ is
$$h:\Bbb Z\to\Bbb N:n\mapsto\begin{cases}
2n,\text{ if }n\ge 0\\
|2n|-1,\text{ if }n<0\;.
\end{cases}$$