TITLE: If every nonzero element of $R$ is either a unit or a zero divisor then $R$ contains only finitely many ideals?
QUESTION [8 upvotes]: Let $R$ be a commutative ring with $1$, if $R$ contains only finitely many ideals, then every nonzero element of $R$ is either a unit or a zero divisor. I know it's true.
How about the converse? i.e. If every nonzero element of $R$ is either a unit or a zero divisor, then $R$ contains only finitely many ideals.
Is it true? Can you give me an example about a commutative ring with $1$ that has infinitely many zero divisors? Thanks.

REPLY [6 votes]: The converse is not true.  Consider the ring $R=\mathbb{C}[x,y]/(x^2,y^2,xy)$.  Notice that every element has a representative of the form $a+bx+cy$.  If $a=0$, this is a zero-divisor.  If $a\ne 0$, then $a^{-1}-a^{-2}bx-a^{-2}cy$ is an inverse.  So this ring satisfies the hypotheses of the question.  Can you exhibit infinitely many ideals of this ring?
$R$ is also an example of an infinite commutative ring with infinitely many zero divisors.