Let $p$ be a nonzero prime element of an integral domain D. This means that whenever $p$ divides a product $ab$ with $a, b \in D$, it must divide $a$ or $b$. Show that $p$ is irreducible.
I tried to solve this question by assuming p is reducible, then there exists $a,b \in D$ such that $ab = p$.
$\Rightarrow p\vert ab$
Since p is a prime element
$\Rightarrow p\vert a$ or $p\vert b$
Assume $p\vert a $ WLOG then $a= pc $ for some $c \in D$
$\therefore p=ab =pcb$
$\Rightarrow p(1-cb) = 0 $
$\Rightarrow p = 0 $ or $bc =1$
Since p is nonzero, so bc=1. Then b and c are units.
After this I don't know how to prove it. Could you please help me to solve it?