Let $p$ be a nonzero prime element of an integral domain D. Show that $p$ is irreducible. 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?

Your proof started out much like the proof of Theorem 1.21 in Alaca & Williams Introductory Algebraic Number Theory, but then you overcomplicated things with $a = pc$.

Let $p \in D$ be a prime and suppose that $p = ab$, where $a, b \in D$. As $ab = p \cdot 1$, we have $p \mid ab$, and so, as $p$ is prime, we deduce $p \mid a$ or $p \mid b$ ... Since $1 = a / p \cdot b$ or $1 = a / b \cdot p$, either $b$ is a unit or $a$ is a unit of $D$.

