Are associates unit multiples in a commutative ring with $1$? Recall the following relevant definitions. We say that


*

*$b$ is divisible by $a$ in $R$, or $a\mid b$ in $R$, if $b = r a$ for some $r\in R$.

*$a$ and $b$ are associates  in $R$ if $a\mid b$ and $b\mid a$, (or, equivalently, if $aR = bR$).

*$u\in R$ is a unit if it has a multiplicative inverse (a $v\in R$ such that $uv=vu=1$).

*$a$ and $b$ are unit multiples in $R$  if $a = ub$ for some unit $u\in R$.
Given these definitions, my question is,

If $R$ is a commutative ring with unity and $a,b\in R$ are associates in $R$, are $a$ and $b$ unit multiples in $R$?

I was told that this not always true. But I encountered some difficulties in finding a counterexample.
 A: This is true if $R$ is a domain. More generally this is true if $a$ or $b$ is not a zero divisor in $R$. Suppose, $a$ is not a zero divisor and there exist $r,s\in R$ such that $a=rb$ and $b=sa$, then $a=rsa$, so $a(1-rs)=0$. Since $a$ is not a zero divisor, $1-rs=0$, so $rs=1$. So, $r,s$ are units. So $a$ and $b$ are associates.
A: On earlier math forums I often cited the little-known article below on this topic (e,g. see sci.math Oct 15, 2008 google groups or mathforum, and Ask an Algebraist 2008, etc)
Beware that this equivalence, i.e. $\rm\ aR = bR \iff a/b\ $ is a unit in $\rm R$,
generally fails when $\rm R $ has zero-divisors, so that there are at least a few different notions of "associate" that are of interest, e.g.

*

*$\ a\sim b\ $ are $ $ associates $ $ if $\, a\mid b\,$ and $\,b\mid a$

*$\ a\approx b\ $ are $ $ strong associates $ $ if $\, a = ub\,$ for some unit $\,u\ \,$ (a.k.a.  unit multiples)

*$\ a \cong b\ $ are $ $ very strong associates $ $ if $\,a\sim b\,$ and $\,a\ne 0,\ a = rb\,\Rightarrow\, r\,$ unit

See said paper below for much further discussion. See also the survey linked here for the effect that this bifurcation has on the notion of unique factorization ring and related matters.
When are Associates Unit Multiples?
D.D. Anderson, M. Axtell, S.J. Forman, and Joe Stickles
Rocky Mountain J. Math. Volume 34, Number 3 (2004), 811-828.
https://projecteuclid.org/journals/rocky-mountain-journal-of-mathematics/volume-34/issue-3/When-are-Associates-Unit-Multiples/10.1216/rmjm/1181069828.full
A: See the following paper,
When are Associates Unit Multiples?
D.D. Anderson, M. Axtell, S.J. Forman, and Joe Stickles
Rocky Mountain J. Math. Volume 34, Number 3 (2004), 811-828.
It is mostly concerned with finding sufficient conditions on
commutative rings that ensure that $Ra=Rb$ implies $a = bu$ for a unit $u$,
but they do give some examples of $R$ where this fails. In particular
this simple example of Kaplansky. Let $R=C[0,3]$, the set of continuous
function from the interval $[0,3]$ to the reals. Let $f(t)$ and $g(t)$
equal $1-t$ on $[0,1]$, zero on $[1,2]$ but let $f(t)=t-2$
on $[2,3]$ and $g(t)=2-t$ on $[2,3]$. Then $f$ is not a unit multiple of $g$
in $R$ but each divides the other.
A: For a counterexample, I will use the ring $R := \mathbb{Z}[a, b, r, s] / \langle b - ra, a - sb \rangle$.  In this ring, we certainly have $b = ra$ and $a = sb$.  It remains to show there is no unit $u \in R^*$ such that $b = ua$.
Thus, suppose we did have $b = ua$.  Then $a(u-r) = 0$.  On the other hand (and here is where the argument gets somewhat technically involved), it can be shown that the kernel of the $R$-module homomorphism $a\cdot : R \to R$ is generated by $rs - 1$.  Therefore, there exists $p \in R$ such that $u = r + p(rs - 1)$.  Also, if $u$ is a unit, then the image $\bar u$ of $u$ in $R / \langle a, b \rangle \simeq \mathbb{Z}[a,b,r,s] / \langle b - ar, a - sb, a, b \rangle = \mathbb{Z}[a,b,r,s] / \langle a, b \rangle \simeq \mathbb{Z}[r,s]$ would also have to be a unit.  But the only units of $\mathbb{Z}[r,s]$ are the constant polynomials $\pm 1$, whereas with $\bar u = r + \bar p (rs - 1)$ we would need to have $\bar u(1, 1) = 1 \ne -1 = \bar u(-1, -1)$ if we consider $\bar u$ as inducing a function $\mathbb{Z}^2 \to \mathbb{Z}$.  This gives a contradiction, so the assumption that $u$ is a unit must have been false.

The basic idea here is that we are in some sense taking the "universal example" of a ring with two associate elements $a,b$ (though with the caveat that the elements $u,v$ making the elements associate are also distinguished, rather than simply assumed to exist somewhere in the ring; and also that the actual universal example would be $\mathbb{Z}[a,b,r,s] / \langle b-ra, a-sb \rangle$ whereas I used $\mathbb{Q}$ for a slightly easier time with the technical details I omitted).  If we had found a unit within $\mathbb{Q}[a,b,r,s] / \langle b-ra, a-sb \rangle$ making $a$ and $b$ associates, then that expression would have worked in particular for any $\mathbb{Q}$-algebra.  On the other hand, once we instead found that there is no unit in this universal example, we already had our counterexample that we needed.
(On the other hand, this shows that trying to work directly with the universal example might not always be the best or easiest approach.  In this example, we had some mildly hairy calculations, ultimately based on Groebner basis theory, that were needed.  However, in the counterexample based on $R = C[0,3]$ in another answer, it was more straightforward to check the details.)

Addendum on the technical detail omitted above, verifying the fact in Macaulay2:
Macaulay2, version 1.16
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, LLLBases, MinimalPrimes, PrimaryDecomposition, ReesAlgebra, TangentCone, Truncations

i1 : R = ZZ[a,b,r,s] / (b - r*a, a - s*b)

o1 = R

o1 : QuotientRing

i2 : mult_a = map(R^1, R^1, matrix {{ a }})

o2 = | a |

             1       1
o2 : Matrix R  <--- R

i3 : kernel(mult_a)

o3 = image | rs-1 |

                             1
o3 : R-module, submodule of R

