**The first case**

At core, this argument can be summarized as:

If $x$ cannot be written as a product of irreducibles, we can get an infinite descending chain of non-trivial divisors. Then the union of the corresponding ascending infinite chain of principal ideals cannot be principal.

If non-unit $x=x_0$ has no factorization into irreducibles, then $x$ is not irreducible, so there must be a factorization of $x =ab,$ with both $a,b$ not units.

Then at least one of $a,b$ must not be writable as a product of irreducibles. Let $x_1$ be that element.

Similarly, let $x_{n+1}$ be a non-trivial factor of $x_n$ such that $x_{n+1}$ cannot be written as a product of irreducibles.

Then you have principal ideal inclusions: $$x_0R\subsetneq x_1R\subsetneq x_2R\subsetneq \cdots $$

Take the union: $I=\bigcup x_nR.$ $I$ is an ideal. Then for any $y\in I,$ $y\in x_{n}R$ for some $n.$ So $yR\subseteq x_nR\subsetneq I.$

So $I$ is not principal.

In fact, you can show that $I$ can’t be generated by a finite set of generators, because any finite set from $I$ is a subset of some $x_nR.$

So, the first case implies that there are non-finitely-generated ideals in $R.$

**The second case**

The second case, you can assume the $p_i$ and $q_j$ are distinct, by cancelling equal irreducible factors.

Then:

$$p_1\mid q_1q_2\cdots q_k$$

Now, if $p_1R+q_iR$ is principal, then it must be all of $R,$ or $p_1,q_i$ cannot be irreducible. So we must have $x_i,y_i\in R$ so that $$p_1x_i+q_iy_i=1.$$

But then taking the product of these equalities, we get $X,Y\in R$ such that:

$$p_1X+(q_1q_2\cdots q_k)Y=1.$$

Recall that $p_1\mid q_1q_2\cdots q_k$: hence the above equation shows that $p_1\mid 1,$ so $p_1$ is not irreducible.

So at least one of the ideals $p_1R+q_iR$ is non-principal.

(Technically, you need a lot more arguments about “distinct up to a product of units,” or that $p_1R\neq q_iR$ for all $i.$)

## Best Answer

Counter-example:Let $K$ be an infinite field. The ring $K[\mkern-1.5mu[X]\mkern-1.5mu]$ has infinitely many units, since a formal power series is invertible if & only if its constant term is non-zero. On the other hand, it has a single prime element, namely $X$.