Let $G$ be a monoid such that cancellation laws hold in $G$ .Show that it is a group.
I want to use the fact that if $G$ is non-empty set such that associativity holds in $G$ and the equations $ax=b$ and $ya=b$ have solutions then $G$ is a group.
But I cant proceed anymore.Any hints
The result is not true in general but is true if $G$ is finite.
Hint. Let $G=\{a_1,\ldots,a_n\}$ be a finite monoid in which the cancellation laws hold. For any fixed $x\in G$, the elements $$xa_1,\ldots,xa_n$$ are all different (this is a consequence of cancellation, see if you can provide the details). Therefore these expressions give all $n$ elements of $G$, and in particular one of them must be the identity element $e$, say $xy=e$. Then we also have $$yxy=ye=y=ey$$ and so $yx=e$. Thus $y$ is the inverse of $x$.