# A necessary and sufficent condition for a ring to be a UFD

I came across the following question in Hungerford's Algebra:

An integral domain $R$ is a UFD iff every non-zero prime ideal contains a nonzero prime principal ideal.

The forward direction is easy. However, I still don't know how to show the backward direction. I know that I need to show the following statement:

Let $\{a_n\}_{n\in Z^+}$ be a sequence in $R$ such that:$$(a_1)\subseteq(a_2)\subseteq(a_3)\subseteq.....$$Then $\exists N\in \mathbb{Z^+}\forall n\geq N[(a_n)=(a_N)]$

But I couldn't figure out how to prove it. Any hints would be appreciated.

Thank you

-
I won't be so sure that you need to prove exactly that statement. See here and also here. –  user26857 Jan 19 '13 at 19:46
See this answer for this and more. –  Math Gems Jan 19 '13 at 20:09