TITLE: In a ring: If every non-zero and non-unit element factors into prime elements, is factorization over irreducible elements unique?
QUESTION [6 upvotes]: Why (not)?
I came up with this question while trying to understand the definition of a UFD.

REPLY [3 votes]: I figured based on the above answer of jgon, I would talk a bit about what happens if $R$ is not a domain.  Maybe something more of an extended comment?
If $R$ has zero-divisors, then there are a lot of definitions of what irreducible means.  The standard one to take is that $a$ a non-unit is irreducible if $a=bc$ implies $(a)=(b)$ or $(a)=(c)$.  As you can see it is pretty clear that prime still implies irreducible.  If $p$ is prime and $p=bc$, then $p\mid b$ or $p\mid c$.  Without loss of generality suppose $p\mid b$, but we also know $b\mid p$ since $p=bc$.  Thus $(p)=(b)$ and $p$ is irreducible.  Clearly, the converse does not hold in general (since it doesn't even in domains see $\mathbb{Z}[\sqrt{-5}]$ for instance.)  
Another note, we don't really need to distinguish zero since $0$ is prime if and only if $0$ is irreducible if and only if $(0)$ is a prime ideal if and only if $R$ is an integral domain.  So in a domain, $0$ always is able to be factored into irreducibles or primes, itself.
It is interesting to see that prime is not actually strong enough to prove some of the stronger definitions of irreducible.  For instance, $a$, a non-unit, is strongly irreducible if $a=bc$ implies that $a=\lambda b$ or $a=\lambda c$ for some unit $\lambda \in U(R)$.  There are even stronger ones (1) m-irreducible is if $(a)$ is maximal among principal ideals and very strongly irreducible stronger still.  
I wrote a bit more about it over here if you are interested: https://mathoverflow.net/questions/101989/divisibility-and-factorization-in-rings-that-are-not-integral-domains/104795#104795
Also, here is a very nice paper which discusses more of these kinds of factorization questions for rings with zero-divisors: http://projecteuclid.org/download/pdf_1/euclid.rmjm/1181072068