Right identity and Right inverse in a semigroup imply it is a group Let $(G, *)$ be a semigroup. Suppose

*

*$ \exists e \in G$ such that $\forall a \in G,\  ae = a$;

*$\forall a \in G, \exists a^{-1} \in G$ such that $aa^{-1} = e$. 
How can we prove that $(G,*)$ is a group?

It is conceptually very simple that a right inverse is also a left inverse (when there is also a right identity). It follows from the axioms above in two steps:
1) Any element $a$ with the property $aa = a$ [i.e. idempotent] must be equal to the identity $e$ in the axioms, since in that case:
$$a = ae = a(aa^{-1}) = (aa)a^{-1} = aa^{-1} = e$$
This already proves the uniqueness of the [right] identity, since any identity by definition has the property of being idempotent.
2) By the axioms, for every element $a$ there is at least one right inverse element $a^{-1}$ such that $aa^{-1}=e$. Now we form the product of the same two elements in reverse order, namely $a^{-1}a$, to see if that product also equals the identity. If so, this right inverse is also a left inverse.  We only need to show that $a^{-1}a$ is idempotent, and then its equality to $e$ follows from step 1:
$$[a^{-1}a][ a^{-1}a] = a^{-1}(a a^{-1})a = a^{-1}ea = a^{-1}a $$
3) It is now clear that the right identity is also a left identity. For any $a$:
$$ea = (aa^{-1})a = a(a^{-1}a) = ae = a$$
4) To show the uniqueness of the inverse:
Given any elements $a$ and $b$ such that $ab=e$, then
$$b = eb = a^{-1}ab = a^{-1}e = a^{-1}$$
Here, as above, the symbol $a^{-1}$ was first used to denote a representative right inverse of the element $a$. This inverse is now seen to be unique. Therefore, the symbol now signifies an operation of "inversion" which constitutes a single-valued function on the elements of the set.
See Richard A. Dean, “Elements of Abstract Algebra” (Wiley, 1967), pp 30-31.
