Integral domain of a commutative ring Let $A$ be a commutative ring over an integral domain. Let $a, b \in A$ where $(a) = (b)$. Show that there exists invertible elements $x$ and $y$ in $A$ such that $a = bx$ and $b = ay$. Also show that $y$ is then the inverse of $x$ and that these elements $x$ and $y$ are unique (for $a$ and $b$ given).
I don't see how I can show the existence of invertible elements, $x$ and $y$. Also for the second proof if I substitute the two equations
$a = bx = ayx$ because of the integral domain of $A$ we have $1 = xy$ so then  $y$ is the inverse of $x$. I don't see after that how I can show that $x$ and $y$ are unique. If anyone as any idea let me know.
 A: Not exactly sure what the semantics of "commutative ring over an integral domain" are all about, but if $A$ is an integral domain, and assuming $(a)$ denotes the principal ideal generated by $a$, that is,
$(a) = aA, \tag 1$
then since $A$ has a unit $1_A$,
$a = a1_A \in aA = (a), \tag 2$
and likewise
$b \in (b); \tag{2.5}$
thus from
$(a) = (b) \tag 3$
we infer that
$a \in (b), \; b \in (a), \tag 4$
and hence
$\exists x, y: a = bx, \; b = ay, \tag 5$
leading to
$a = (ay)x = a(xy), \tag 6$
or
$a(1_A - xy) = a - a(xy) = a - a = 0; \tag 6$
if we now hypothesize that
$a \ne 0, \tag 7$
the assumption that $A$ is an integral domain forces
$xy = 1_A, \tag 8$
that is, both $x$ and $y$ are invertible and
$y = x^{-1}, \; x = y{-1}. \tag 9$
The uniqueness of $x$ is seen via
$bx = a = bx' \Longrightarrow b(x - x') = 0 \Longrightarrow x - x' = 0 \Longrightarrow x = x', \tag{10}$
provided of course
$b \ne 0; \tag{11}$
thus $x$ is unique; a similar argument applies to $y$.
We observe that (7) and (11) are equivalent since both imply (8)-(9).  In the event that
$a = 0, \tag{12}$
we also have
$b = 0, \tag{13}$
since we have shown that
$a \ne 0 \Longleftrightarrow b \ne 0; \tag{14}$
this also follows from
$a = 0 \Longleftrightarrow (a) = aA = \{0\} \Longleftrightarrow bA = (b) = (a) = \{0\} \Longleftrightarrow b = 0. \tag{15}$
