Prob. 14, Sec. 2.3, in Herstein's TOPICS IN ALGEBRA, 2nd ed: A finite set with an associative binary operation and both cancellation laws is a group Suppose a finite set $G$ is closed under an associative product and that both cancellation laws hold in $G$. Prove that $G$ must be a group.
The cancellation laws run as follows:
For any elements $a, u, w \in G$, 
(1) $a \cdot u=a \cdot w$ implies $u=w$, and 
(2) $u \cdot a = w \cdot a$ implies $u=w$.
 A: Suppose that $G$ has $n$ elements. 
The cancellation laws imply that, for any element $a \in G$, the map $\phi_a: G \to G$ given by 
$$ \phi_a(g) \colon= ag $$
for $g \in G$, is a permutation of $G$ (i.e. a permutation of $n$ objects and hence an element of the symmetric group $S_n$). Each permutation is identity when raised to an appropriate power. Thus there is an element $e_{\mbox{left}} \in G$ such that the map $\phi_{e_{\mbox{left} } }$ is the identity permutation, that is, such that $ e_{ \mbox{left} } g = g$ for every $g \in G$. 
Moreover, if $g \in G$, then since the map $\psi_g \colon G \to G$ defined by
$$ \psi_g(x) \colon= xg$$
for $x \in G$, is also a permutation of $G$ (i.e. a bijective self-map of $G$), therefore there exists an element $g_{\mbox{left}} \in G$ such that 
$$ \psi_g \left( g_{ \mbox{left} } \right) = e_{\mbox{left}}, $$
that is such that
$$ g_{\mbox{left}} g = e_{\mbox{left}}. $$
So you have a left unity and a left inverse (because a map given by right multiplication is also a permutation). Thus it is a group.
Just saw, that on wiki page for group there is no definition with only one-sided units and inverses. So I will continue:
We know  that for all $a \in G$, we have
$$e_{\mbox{left}}a=a.$$
And, for each $a \in G$, there exists an element $a_{\mbox{left}} \in G$ such that
$$ a_{\mbox{left}} a = e_{\mbox{left}}. $$
Let us put
$$ l(a) \colon = a_{\mbox{left}}. $$
Thus for each element $a \in G$, there exists an element $l(a) \in G$ such that
$$ l(a) \; a = e_{\mbox{left}}. $$
Then we obtain
$$ l(a) = e_{\mbox{left}} l(a)  = \left(  l( a) \ a  \right)\  l(a), $$
and so 
$$ e_\mbox{left} = l \big( l(a) \big) \; l(a) = l \big(l(a)\big) \; \left[ \left(  l( a) \ a  \right)\  l(a) \right] = \left( l\big(l(a)\big) \; l(a) \right) \left( a \; l(a) \right) = e_\mbox{left} \left( a \; l(a) \right) = a \; l(a).  $$
Thus we have
$$ a\; l(a) = e_\mbox{left} = l(a) \; a. $$
Finally, we have
$$ a e_\mbox{left} = a \big( l(a) a \big) = \big( a l(a) \big) a = e_\mbox{left} a = a. $$
Thus we also have
$$ a e_\mbox{left} = a = e_\mbox{left} a. $$
A: I am reading "Topics in Algebra 2nd Edition" by I. N. Herstein.
This problem is Problem 14 on p.36.
I solved this problem as follows:

Let $a$ be an arbitrary element of $G$.
Let $S_a$ be a mapping from $G$ to $G$ such that $S_a(x)=x\cdot a$.
By the right cancellation law, $S_a$ is injective.
Since an injective mapping from a finite set $S$ to $S$ is bijective, $S_a$ is bijective.
Let $T_a$ be a mapping from $G$ to $G$ such that $T_a(x)=a\cdot x$.
By the left cancellation law, $T_a$ is injective.
Since an injective mapping from a finite set $S$ to $S$ is bijective, $T_a$ is bijective.
It is obvious that $S_a(b)=T_b(a)$ holds for any $a,b\in G$.
Since the product on $G$ is associative, $S_aT_b=T_bS_a$ holds for any $a,b\in G$.
Since $S_a$ is surjective, there is an element $x\in G$ such that $S_a(x)=a$.
Let $b$ be an arbitrary element of $G$.
Then, $S_a(T_b(x))=T_b(S_a(x))=T_b(a)=S_a(b)$.
Since $S_a$ is injective, $T_b(x)=b$.
So, $x$ is a right identity.
Let $b$ be an arbitrary element of $G$.
Since $T_b$ is surjective, there exists $y\in G$ such that $T_b(y)=x$.
So, $b$ has its right inverse.
By Problem 12 on p.35, $G$ is a group.

