Can a product of non-principal ideals be principal, in a local ring?

Let $(R,\mathfrak m)$ be a local (not necessarily noetherian) ring, $a\in R$ a non-zero divisor, and $I,J\subset R$ ideals such that $IJ=(a)$. Then $I$ and $J$ are principal.

Write $a=\sum_{i}a_ib_i$ with $a_i\in I$ and $b_i\in J$. Then $I(a^{-1}J)=R$. (Note that $a^{-1}J$ is an $R$-submodule of $Q(R)$, the total ring of fractions of $R$, and this is the frame where the last equation holds.) From $1=\sum_{i}a_i(a^{-1}b_i)$ it follows that $a_i(a^{-1}b_i)\notin\mathfrak m$ for some $i$. Now show that $I=(a_i)$.


In a local domain, every invertible ideal is principal. The proof of this fact can be found in Kaplansky's book "Commutative rings", page 37, Theorem 59.