Question about proof on commutative algebra. I deleted my previous post in order to make a more specific one. Im supposed to prove a proposition and i wonder if my proof holds, i will start with a definition:
"Let $R$ be a commutative ring, a nonzero element $p$ of $R$ is said to be irreducible if the following to conditions hold:
$\textbf{(i)}$: $p$ is not a unit of $R$. $\textbf{(ii)}$: if $p=ab$ for $a,b, \in R$, then either $a$ or $b$ is a unit of $R$."
$\textbf{Proposition}$: Let $D$ be a principal ideal domain and let $p$ be a nonzero element of $D$. Then $p$ is irreducible in $D$ if and only if $pD$ is a prime ideal of $D$.
$\textbf{Proof}$: I have proven that if it is irreducible then it must be a prime ideal so lets take the other implication.
Assume that $pD$ is a prime ideal of $D$, then $p$ can not be a unit because if it was then we would have $pp^{-1}=1 \in pD$, contradicting the definition of a prime ideal as a proper ideal. Now suppose that $p$ is not irreducible, since $(i)$ holds (from above definition) then $(ii)$ can not hold, so if we can write $p =ab$ for $a,b \in D$ then both $a$ and $b$ must be nonunits, however we can write $p = 1*p$, this contradicts the definition of $1$ as an identity element and hence a unit. Thus $p$ is irreducible.
Does this proof hold?
 A: I don't get the last argument, which imo should be along the lines:
$$ab\in pD\implies a\in pD\;\;or\;\;b\in pD\implies\begin{cases}p\mid a\\{}\\or\\{}\\p\mid b\end{cases}$$
and we're done.
A: Hint: Besides being a proper ideal, a prime ideal also satisfies the following property (in its definition):
If $a, b \in D$ are such that $ab \in pD$, then $a \in pD$ or $b \in pD$. 
I think you should use this in your proof somehow.
A: The proof is not valid; you made a mistake: for (ii) to be false, it means there exist $a, b$ nonunits such that $p = ab$, it doesn't mean that if $p = ab$ then both $a, b$ must be nonunits; obviously, as you noted $p = 1 \cdot p$ and $1$ is a unit!
Notice that in a PID, an element is prime if and only if it is irreducible. The result you want follows from the following:
Lemma: Let $A$ be a ring and $p \in A$, then $p$ is prime if and only if $(p)$ is prime.
Proof: Let $p$ be prime and let $xy \in (p)$, then $xy = pr$ for some $r \in A$ which means $p \mid xy$. Since $p$ is prime, either $p \mid x$, in which case $x = pr_x \in (p)$ for some $r_x \in A$ or $p \mid y$, in which case $y = pr_y \in (p)$ for some $r_y \in A$. Conclude that $(p)$ is prime by definition.
Conversely, suppose $(p)$ is prime and let $p \mid xy$, then $xy = pr$ for some $r \in A$ which means $xy \in (p)$. Since $(p)$ is prime, either $x \in (p)$ in which case $x = pr_x$ for some $r_x \in A$ which means $p \mid x$, or $y \in (p)$ in which case $y = pr_y$ for some $r_y \in A$ which means $p \mid x$. Conclude by definition that $p$ is prime.
