Let $$\Bbb Z_p[i]:=\{a+bi\;:\; a,b \in \Bbb Z_p\,\,,\,\, i^2 = -1\}$$
-(a)Show that if $p$ is not prime, then $\mathbb{Z}_p[i]$ is not an integral domain.
-(b)Assume $p$ is prime. Show that every nonzero element in $\mathbb{Z}_p[i]$ is a unit if and only if $x^2+y^2$ is not equal to $0$ ($\bmod p$) for any pair of elements $x$ and $y$ in $\mathbb{Z}_p$.
(a)I think that I can prove the first part of this assignment. Let $p$ be not prime. Then there exist $x,y$ such that $p=xy$, where $1<x<p$ and $1<y<p$. Then $(x+0i)(y+0i)=xy=0$ in $\mathbb{Z}_p[i]$. Thus $(x+0i)(y+0i)=0$ in $\mathbb{Z}_p[i]$. Since none of $x+0i$ and $y+0i$ is equal to $0$ in $\mathbb{Z}_p[i]$, we have $\mathbb{Z}_p[i]$ is not an integral domain.
However, I don't know how to continue from here.