Prove that a UFD is a PID if and only if every nonzero prime ideal is maximal.
The forward direction is standard, and the reverse direction is giving me trouble. In particular, I can prove that if every nonzero prime ideal is maximal then every maximal ideal is principal. From here, I know every ideal $I$ is contained in a maximal ideal, and that maximal ideal is principal, but I can't quite conclude that $I$ must also be principal.
In particular, this is not true for sub-ideals of principal ideals in general rings, so I was looking at the set of all maximal ideals containing I, and trying to argue something about factorization but I can't quite get there. Any hints?
Ok, so it seems to me what you're saying is that you've proven that under the condition that every prime ideal is maximal that every maximal ideal is principal. The problem then follows from a nice condition you might want to remember:
I'll outline the proof here for you. Suppose that every element of $\text{Spec}(R)$ is principal and suppose the set $\mathscr{N}$ of non-prinicpal ideals was non-empty. It's pretty easy to show then that every ascending chain in $\mathscr{N}$ has an upper bound from where Zorn's lemma gives you that $\mathscr{N}$ has a maximal element, call it $\mathfrak{a}$ which is a non-prinicpal ideal. We claim that $\mathfrak{a}$ is actually not prime (towards a contradiction). We see then that there exists $a,b\notin \mathfrak{a}$ with $ab\in \mathfrak{a}$. Note then that $\mathfrak{a}_a=(\mathfrak{a},a)$ and $\mathfrak{a}_b=(\mathfrak{a},b)$ are proper supersets of $\mathfrak{a}$ and so must be principal, say equal to $(\alpha)=\mathfrak{a}_a$ (we only really care about the one). Define then $\mathfrak{b}$ to be the ideal quotient of $\mathfrak{a}$ in $\mathfrak{a}_a$. Prove that $\mathfrak{b}$ contains $\mathfrak{a}_b$ and so is principal, say $\mathfrak{b}=(\beta)$. Show then that $\mathfrak{a}=\mathfrak{a}_a\mathfrak{b}$ so that $\mathfrak{a}=(\alpha\beta)$ contradictory to assumption.
This contradiction allows us to conclude that $\mathscr{N}$ must have been empty.