This thread (including comments from both Jeremy and Alex) was very useful to me in PhD Quals preparation.
I would like to give a detailed proof using Jeremy's and Alex's outline, but without mention of Spec(R), in case the reader is less algebraic-geometry-inclined.
Corrections welcome. Thanks.
Proposition. Let R be a UFD in which every nonzero prime ideal is maximal. Then R is a PID.
Lemma 1. If p is a nonzero irreducible element of R, then (p) is a prime ideal of R.
Proof. Let a and b be nonzero elements of R such that ab ∈ (p), i.e. ab = pf for some nonzero element f ∈ R. If a and b are both non-units, then we can write their unique factorisations a = up1...pr and b = vq1...qs for unique irreducible elements pi and qj, and units u and v ∈ R. By unique factorisation, p = one of the pi's, or p = one of the qj's, or both. Hence either a ∈ (p) or b ∈ (p) or both. [Similar reasoning works if either a or b is a unit of R.] Thus, (p) is a prime ideal.
Lemma 2. If I is a nonzero prime ideal of R, then I is principal.
Proof. Given a nonzero, proper prime ideal, $I$, with some element $r\in I$, write $r= p_1\cdots p_n$ as a product of primes. By the primality of $I$ we know some $p_i\in I$. Since $p_i$ is prime, by assumption $(p_i)$ is maximal, so $(p_i)\subseteq I$ implies that $I=(p_i)$.
Proof of Proposition.
Following Alex's thread, let N be the set of non-principal ideals in R. Suppose that N is non-empty. N is a partially ordered set (with inclusion of ideals being the ordering relation). Any totally ordered subset of ideals J1 ⊆ J2 ⊆ ... in N has an upper bound, namely J = ∪ Ji. J is an ideal of R because the subset was totally ordered. If J = (x) for some x ∈ R, then x ∈ Ji for some i, and hence (x) = Ji. Contradiction. Thus, J ∈ N and by Zorn's Lemma, N has a maximal element. Call it n.
By Lemma 2, we see that n is not a prime ideal of R. Thus, there exist a, b ∈ R, such that a, b ∉ n, but ab ∈ n. But then n + (a) and n + (b) are ideals in R which are strictly bigger than n, and so must be principal ideals, i.e. n + (a) = (u) and n + (b) = (v) for u, v ∈ R. Then we have
n = n + (ab) = (n + (a)) (n + (b)) = (u)(v) = (uv). Contradiction.
Thus, N must be the empty set, i.e. all ideals in R are principal.
Suppose $\def\ZZ{\mathbb Z}I\subseteq\ZZ\times\ZZ$ is an ideal.
If $(x,y)\in I$, then $(x,0)=(1,0)(x,y)$ and $(0,y)=(0,1)(x,y)$ are also in $I$. If we write $I_1=\{x\in\ZZ:(x,0)\in I\}$ and $I_2=\{y\in\ZZ:(0,y)\in I\}$. then it follows easily from this that $I=I_1\times I_2$. Now $I_1$ and $I_2$ are ideals of $\ZZ$, so that there are $a$, $b\in\ZZ$ such that $I_1=(a)$ and $I_2=(b)$, and then $I$ is generated by $(a,b)$.
Best Answer
The claimed result is false: For $R/I$ to be a principal ideal domain, it must be a domain. But $R/I$ is a domain if and only if $I$ is a prime ideal. In particular, $\mathbb{Z}/6\mathbb{Z}$ is a quotient of a PID that is not a domain, hence not a PID.
What is true is that a quotient of a PID will be a principal ideal ring: every ideal of $R/I$ is principal. Your argument is confused because you are using the same letter to denote the ideal of $R/I$ and the ideal it corresponds to inside $R$. Better to use different letters.
Indeed, let $K$ be an ideal of $R/I$. By the Correspondence Theorem $K$ corresponds to an ideal $J$ of $R$ that contains $I$. Since $R$ is assumed to be a PID, then $J=(j)$ for some $j\in R$. The claim is that $K = (j+I)(R/I)$: let $k+I\in K$. Then $k+I \in J+I$, so there exists $a\in J$ such that $k+I = a+I$, which means $a-k\in I$; since $I\subseteq J$, we conclude that $a-(a-k) = k\in J$. Therefore, $k=jx$ for some $x\in R$, so $k+I = jx+I = (j+I)(x+I)\in (j+I)(R/I)$. Thus, $K\subseteq (j+I)(R/I)$. And since $j+I\in K$ and $K$ is an ideal, then $(j+I)(R/I)\subseteq K$, giving equality.