Right identity and Right inverse implies a group Let $(G, *)$ be a semi-group. 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.
Most proofs I've seen contains many ingenious equations. The motivation behind these equations is not very clear. Here I present a more intuitive proof.

For any element $a$ in $G$, we can map it to a function $f_a:G \to G$, simply define $f_a(x) = xa$. We can see that every right identity element $e$ is mapped to the identity function $id$,
$$f_e=id,$$
and the operation on $G$ amounts to function composition:
$$ f_{ab} = f_b \circ f_a, $$
and the existence of right inverses means for any $a$ there is an $a^{-1}$ such that
$$f_{a^{-1}} \circ f_a = id.$$
That will imply that every function $f_a$ is injective, otherwise the composition of it, which is $id$, can't be injective either. Actually, it's bijective, but we don't have to use that strong conclusion here.

We want to show $a^{-1}a=e$. Because $f_{a^{-1}a} = f_a \circ f_{a^{-1}}$, we wonder whether $f_a \circ f_{a^{-1}} =id$. Intuitively that should be true since $f_{a^{-1}} \circ f_a = id$ and both $f_a$ and $f_{a^{-1}}$ are bijective. For a proof that only assumes that one of them is injective, see Lemma below.

Now that $f_{a^{-1}a} = f_e$, to prove $a^{-1}$ is a left inverse, we only need to show that for any $c \in G$ and $c' \in G$, $f_c = f_{c'}$ implies $c=c'$. We try to calculate $f_c(e)$:
$$f_c(e) = ec = (cc^{-1})c = c(c^{-1}c)=f_{c^{-1}c}(c)=id(c)=c.$$
For the same reason $f_{c'}(e) = c'$, so $c=c'$. Note here $ec=c$, so it has already proved every right identity is a left identity.

The uniqueness of the identity element is induced by the uniqueness of the identity function, for $f_e=f_{e'}$ implies $e=e'$, and also the uniqueness of inverse elements is induced by the uniqueness of inverse functions.

So we've proved $G$ is a group.


  Lemma.  Let $X$ and $Y$ be two arbitrary sets. Let $f$ be a function $f: X \to Y$ and $g$ be another function $g: Y \to X$.
  Suppose $g$ is injective, and $g \circ f = id$, then $f \circ g = id$.
  
  Proof. Let $y \in Y$, we want to show that $(f \circ g)(y) = y$. Let $y' = (f \circ g)(y)$. Apply $g$ to both side, $$g(y')=(g \circ f \circ g)(y) = (id \circ g)(y) = g(y).$$ So $y'=y$.