I need to find an example of a ring that is not a PID but every ideal is principal. I know that $\mathbb Z\times\mathbb Z$ is not an integral domain, so certainly is not a PID, but here every ideal is principal. I already proved that if $R$ and $S$ are ring every ideal in $R \times S$ is $I \times J$ with ideals in the original ring. But I cant follow from that that $\mathbb Z\times\mathbb Z$ has only principal ideals.
Explicitly, if $I$ is an ideal $(a)\times(b)$ which would be its generator $(c,d)$ in $\mathbb Z\times\mathbb Z$?
Thanks.
Observe that every ideal in $R= \Bbb Z/n\Bbb Z$ is principal but, for $n$ not prime, $R$ has zero divisors, so it's not a PID.