You use the fact that an integral domain has a cancellation law.
In Dummit and Foote, Section 8.3 on Unique Factorization Domains, Proposition 10 reads as follows:
Proposition 10: In an integral domain a prime element is always irreducible.
The proof reads as follows:
Suppose (p) is a non-zero prime ideal and p = ab.
Then , so by definition of prime ideal, one of a or b, say a, is in (p).
Thus a = pr for some r.
This implies p = ab = prb and so rb = 1 and b is a unit.
This shows that p is irreducible.
My question is as follows: Where in this proof do D&F use the fact that p is in an integral domain??? (It almost reads as if this applies for any ring)
I was just imagining that they were pre-multiplying both sides by the inverse of p, but of course that assumes p has an inverse, and we do not necessarily have a field - only an integral domain.
Presumably the cancellation law can operate without p having an inverse???