I know that in a domain $A$, $a,b\in A$ are associates if and only if there exists a unit $u\in A$ such that $a=bu$. But, when A is not a domain, but a general unitary and commutative ring, we can only prove the second implication.
However, I haven't been able to find a counterexample ( a pair a,b in a unitary and commutative ring such that a and b are associates but there is no unit u such that $a=bu$). Of course, as I was told the biconditional was only true in domains, I tried looking at rings $\mathbb{Z}_n$ with n no prime. But, the double implication seems to hold for all of them.
My question are:
1)Is it true the double implication in every $\mathbb{Z}_n$? Does it hold for any principal ideal ring? If the answer is yes, how can I prove it?
2)Can you give a counterexample for the double implication?