I proved that in an integral domain that the implication always holds, but apparently it doesn't necessarily hold in all rings, and I have been looking for counterexamples. But, I'm confused why this proof that doesn't use the assumption of $R$ being an integral domain fails (and certainly it fails since I'm "proving" a false result):
Let $R$ be a ring, not necessarily an integral domain. Say $$ (a) = (b) $$ Thus, $a\in (b)$ and therefore $a = b\circ c$ for some $c\in R$.
Further, $b\in (a)$ and similarly $b = a\circ g$.
Thus, plugging in $b = a\circ g$, we get $a = a\circ g\circ c$. Hence, $g\circ c = 1$, so $g, c\in R^*$. Thus, letting $u = c$, we get $a = b\circ u$ for some unit $u$.
I'm unsure why this proof fails.