For a monoid $G$, consider the following conditions:
(i) $G$ is a group.
(ii) For $a, x, y ∈ G$, each of the equations $ax = ay$ and $xa = ya$ implies $x = y$.
Then (i) $\implies$ (ii). Show that the reverse implication holds for finite monoids $G$, but not for arbitrary monoids G.
I think that I need to prove this problem by proving that ever $a \in G$ has an inverse that is also in $G$. I also think that $x$ is the inverse of $a$ since one of the axioms in group theory states that for all $a\in G$, there exists another element $b\in G$ such that $ba=e=ab$. I've tried showing $ax=xa$ since I think that this would imply that the equation is equal to $e$ and thus $x$ is the inverse of $a$. I've done this by multiplying x to both sides of $ax=ay$ to get $x(ax)=x(ay)=(xa)y=(ya)y=(ya)x$ but I can't seem to deduce how this would lead to $ax=xa=e$.