Let $M$ be a commutative monoid with the cancelation law. Show that an lcm doesn´t exist under these conditions. Let $M$ be a commutative monoid with the cancelation law and suppose that $a \nsim b, x \nsim y, ax = by, ay = bx$, and $a$ and $b$ are irreducible. A first question was to show that $\gcd(ax,bx) = \emptyset$. Then, we have to show that if $a \nmid y$ or $b \nmid x$, then the set of least common multiples of $(a,b)$ is the empty set. I managed to do the first one after a lot of thinking, but I can't understand the second one. I tried a proof by contradiction, but I can't get to a contradiction.
The proof for the first part goes like this:
Suppose that $\gcd(ax,bx) \neq \emptyset$. Then, $\gcd(ax,bx) = x \gcd(a,b) = x U(M)$, where $U(M)$ are the units of the monoid. Then, $a = xu$ and $b = xu^\prime$, thus $ax=by$ leads to $x \sim y$, which is a contradiction.
EDIT: Originally I had said this was an integral domain, it is actually a monoid, only the operation of multiplication exists.

Note that for any $z\in M$, if $x,y$ are replaced by $xz,yz$, the hypotheses of the problem are still satisfied.

Thus your assertions that $a\sim x$ and $b\sim x$ are not justified.

Instead, we can argue as follows . . .

Assume that $\gcd(ax,bx)$ exists.

Our goal is to derive a contradiction.

From the equations
$$
\left\lbrace
\begin{align*}
ax&=by\\[4pt]
ay&=bx\\[4pt]
\end{align*}
\right.
$$
we get $abx^2=aby^2$, so $x^2=y^2$.

As you noted, since $\gcd(a,b)=1$, we get
$$
\gcd(ax,bx)=x{\,\cdot\,}\gcd(a,b)=x
$$
Then from $ax=by$ we get $y{\,\mid\,}ax$, and from $ay=bx$ we get $y{\,\mid\,}bx$, so $y$ is a common divisor of $ax$ and $bx$.

Hence $y{\,\mid}\gcd(ax,bx)$, so $y{\,\mid\,}x$.

Then $x=yz$ for some $z\in M$, hence
\begin{align*}
&
x^2=y^2
\\[4pt]
\implies\;&
x(yz)=y^2
\\[4pt]
\implies\;&
xz=y
\\[4pt]
\implies\;&
x{\,\mid\,}y
\\[4pt]
\end{align*}
But then we have $x{\,\mid\,}y$ and $y{\,\mid\,}x$, so $x\sim y$, contradiction.

Therefore $\gcd(ax,bx)$ does not exist.

Next we show that $\text{lcm}(ax,bx)$ does not exist.

The following lemma will clinch it . . .

Lemma:$\;$If $s,t\in M$ and $\text{lcm}(s,t)$ exists, then $\gcd(s,t)$ exists.

Proof of the lemma:

Let $m=\text{lcm}(s,t)$.

Let $g,h\in M$ be such that $m=gs$ and $m=ht$.

Since $st$ is a common multiple of $s$ and $t$, it follows that $st=em$ for some $e\in M$.

Then
$$em=st\implies e(ht)=st\implies eh=s\implies e{\,\mid\,}s$$
and
$$em=st\implies e(gs)=st\implies eg=t\implies e{\,\mid\,}t$$
so $e$ is a common divisor of $s$ and $t$.

Now let $d$ be any common divisor of $s$ and $t$.

Then $s=ds_1$ and $t=dt_1$ for some $s_1,t_1\in M$.

Now $ds_1t_1$ is a common multiple of $s$ and $t$, hence $ds_1t_1=km$ for some $k\in M$, so then
\begin{align*}
&
st=em
\\[4pt]
\implies\;&
(ds_1)(dt_1)=em
\\[4pt]
\implies\;&
(d)(ds_1t_1)=em
\\[4pt]
\implies\;&
(d)(km)=em
\\[4pt]
\implies\;&
dk=e
\\[4pt]
\implies\;&
d{\,\mid\,}e
\\[4pt]
\end{align*}
hence $\gcd(s,t)=e$, which completes the proof of the lemma.

Since we've already shown that $\gcd(ax,bx)$ does not exist, it follows from the lemma that $\text{lcm}(ax,bx)$ does not exist, as was to be shown.
