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?

I assume that (a) should read $\exists e\in G$ such that $ae=a$, $\forall a\in G$. For each $a \in G$ we have
$$\begin{align*}
(a^{-1})^{-1}a^{-1} &= e[(a^{-1})^{-1}a^{-1}]\\
&= (aa^{-1})[(a^{-1})^{-1}a^{-1}]\\
&= [(aa^{-1})(a^{-1})^{-1}]a^{-1}\\
&= (a[a^{-1}(a^{-1})^{-1}])a^{-1}\\
&= (ae)a^{-1}\\
&= aa^{-1}.
\end{align*}$$
Multiplying $(a^{-1})^{-1}a^{-1} = aa^{-1}$ on the right by $(a^{-1})^{-1}$ yields $$\begin{align*}
(a^{-1})^{-1} &= (a^{-1})^{-1}e\\
&= (a^{-1})^{-1}[a^{-1}(a^{-1})^{-1}]\\
&= [(a^{-1})^{-1}a^{-1}](a^{-1})^{-1}\\
&= (aa^{-1})(a^{-1})^{-1}\\
&= a[a^{-1}(a^{-1})^{-1}]\\
&= ae\\
&= a,
\end{align*}$$
so $a^{-1}a=e$ for all $a \in G$. 

Added: The foregoing obviously assumes that $e$ is a left identity, which was not given, and somehow none of us caught it at the time. Here is a corrected argument. For each $a\in G$ we have $$a^{-1}=a^{-1}e=a^{-1}(aa^{-1})=(a^{-1}a)a^{-1}\;,$$ so $$e=a^{-1}(a^{-1})^{-1}=\left((a^{-1}a)a^{-1}\right)(a^{-1})^{-1}=(a^{-1}a)\left(a^{-1}(a^{-1})^{-1}\right)=(a^{-1}a)e=a^{-1}a\;.$$

In other words, $a^{-1}$ is both a left as well as a right inverse for $a$. It follows that 
$$ea = (aa^{-1})a = a(a^{-1}a) = ae = a\;,$$ 
so $e$ is a left as well as a right identity for $G$. Now you can use the usual arguments to show that the identity and inverses are unique. (For example, if $e'$ were another identity, we’d have $e = ee' = e'$, because $e$ is a left identity and $e'$ is a right identity.)
