Units of Gaussian integers
Solution 1:
If $z,w\in\mathbb{Z}[i]$ are such that $zw=1$ (i.e. $z$ is a unit and $w$ its inverse), then $|z|^2|w|^2=|zw|^2=1$, or
$$(a^2+b^2)(c^2+d^2)=1, \quad z=a+bi,\; w=c+di.$$
Now $a,b,c,d$ are all integers, so $a^2+b^2$ and $c^2+d^2$ must both be nonnegative integers, which must both equal exactly $1$ and no greater in order to multiply to $1$ in the integers. And if $a^2+b^2=1$, we have $a^2$ and $b^2\le1$. Check by hand the only solutions here correspond to $(a,b)=(\pm1,0)$ or $(0,\pm1)$.
Solution 2:
Alternatively, $\mathbb{Z}[i] = \{ a + bi : a,b \in \mathbb{Z}\}$. So the norm of $\mathbb{Z}[i]$ is $a^{2} + b^{2}$. Now, $a+bi$ is a unit if and only if $a+bi$ divides $1$. Hence $N(a+bi)=\pm 1. $
So, $a^{2} + b^{2} = \pm 1$ Since $a,b \in \mathbb{Z}$, the only solutions are $a=\pm 1$, $b=0$ and $a=0$, $b=\pm1$. So the units are $1, -1, i, -i$
Solution 3:
Units are those elements in a ring that are invertible. Assume $a+bi$ is a unit.
Then $\exists\ c+di \in \mathbb Z[i]$ such that $(a+bi)(c+di)=1$. This implies $$\begin{cases}ac-bd=1\\bc+ad=0 \end{cases}$$
Now solve this system and remember that $a,b,c,d \in \mathbb Z$.
We get from the second equation that $bc=-ad$. This means that, from the first equation, $$\text{If $b \neq0$, then, } d(a^2+b^2)=-b.$$
This leaves you with two possibilities: $d=-1$ 0r $d=-b$.
But, if $d=-b$ then, we have that $c=a$ and $a^2+b^2=1$. Now since we have been given that $b \neq 0$ the only solution for $a^2+b^2=1$ with $a,b \in \mathbb Z$ will be $a=0$ and $b=\pm 1$.
Now, if $d=-1$, then note that if $c=0$, we immediately have that $b=1$.
More generally, the last equation we derived from the system gives you that, $b(1-b)=a^2$ which has no integral solutions if $b \neq 0$.
For the last case, if $b=0$, then, the Gaussian integer is just $a$ and $a$ has an inverse in $\mathbb Z[i]$ iff $a=\pm 1$. This is because, the multiplicative inverse is $\frac{1}{a}$, which will be in $\mathbb Z$ iff $a=\pm 1$.