Show that the following map is a bijection $$g(x,y) = \frac{1}{2}(x-1)x + y$$ 
where $g:\mathbb{Z}^+ \times \mathbb{Z}^+ \longrightarrow \mathbb{Z}^+$
Attempt: I am only having problems with proving the injectivity part so that is all I'm going to write up here.
Assume $(x_1,y_1)$, $(x_2,y_2)$ mapped to the same point in the codomain:     $$\implies g(x_1,y_1) = g(x_2,y_2) \\ \implies \frac{1}{2}(x_1-1)x_1 + 1 = \frac{1}{2}(x_2-1)x_2 + y_2 \\ \implies x_1^2-x_1 + y_1 = x_2^2-x_2 + y_2$$         this is the step where I am stuck. I know I need to show $(x_1,y_1) = (x_2,y_2)$ but I haven't seen how to do that here.
 A: You’ve misunderstood Munkres’ argument. He does not say that the function $g$ is a bijection from $\Bbb Z^+\times\Bbb Z^+$ to $\Bbb Z^+$: it’s a bijection from $A$ to $\Bbb Z^+$, where 
$$A=\{\langle x,y\rangle\in\Bbb Z^+\times\Bbb Z^+:y\le x\}\;.$$
Note that this disposes of KittyL’s example, since $\langle 1,4\rangle\notin A$.
It is then to be combined with the bijection
$$f:\Bbb Z^+\times\Bbb Z^+\to A:\langle x,y\rangle\mapsto\langle x+y-1,y\rangle$$
to yield a bijection $g\circ f:\Bbb Z^+\times\Bbb Z^+\to\Bbb Z^+$.
The second illustration in his Figure $7.1$ shows the set $A$ and the order in which the function $g$ enumerates. In order to see what’s going on, it may help to realize that 
$$\frac12(x-1)x=\sum_{k=1}^{x-1}k\;,$$
the total number of points in the columns to the left of $x$.
Added: In this case it’s probably easier to show injectivity of $g$ directly, by showing that if $\langle x_1,y_1\rangle\ne\langle x_2,y_2\rangle$, then $g(x_1,y_1)\ne g(x_2,y_2)$. Suppose that $\langle x_1,y_1\rangle\ne\langle x_2,y_2\rangle$; there are two cases.


*

*If $x_1\ne x_2$, we may assume without loss of generality that $x_1<x_2$. Show that in this case $g(x_1,y_1)<g(x_2,y_2)$; use the fact that $y_1\le x_1$.

*Then consider the case $x_1=x_2$.
