I'm reading Dummit&Foot and got stuck at page 290.
Let O be a quadratic integer ring and $\pi$ be prime in O. Then $(\pi)\cap \mathbb{Z} =pZ$ for some prime integer. Since $p\in (\pi)$ we have $p=\pi \pi'$. So $p^2=N(\pi)N(\pi')$. Assume that $N(\pi)=\pm p^2$. Then $N(\pi')=\pm 1$ so $\pi'$ is a unit and $p=\pi$ (up to assoicates) is irreducible in $\mathbb{Z}[i]$.
Why $\pi$ is irreducible?
If we consider the case where $p=\pi$, then $p$ is not always irreducible. For example, $p=2=(1+i)(1-i)$ and none of these factors are units, because their norms are $1^2+1^2=2$. So what am I missing?