TITLE: A finite, cancellative semigroup is a group
QUESTION [30 upvotes]: Let $G$ be a finite, nonempty set with an operation $*$ such that

$G$ is closed under $*$ and $*$ is associative
Given $a,b,c \in G$ with $a*b=a*c$, then $b=c$.
Given $a,b,c \in G$ with $b*a=c*a$, then $b=c$.

I want to prove that $G$ is a group, but I don't know how to show that there exists an identity $e\in  G$ such that $e*x=x$ and $x*e=x$ $\forall x \in G$. I also don't know how to show that $\forall$ x $\in G$ there exists a $y \in G$ such that $y*x=e$ and $x*y=e$. How do I do this?

REPLY [2 votes]: Given $g \in G$, by finiteness of $G$ and condition $2$, left multiplication $l_g : G \to G$ by $g$ is a permutation of $G$. Then, by associativity of $*$, the map $g \mapsto l_g$ is a magma homomorphism. By condition $3$, this map is an injection. Thus, the magma $G$ can be embedded into $S_{|G|}$. Since any nonempty subset of any finite group, which is closed under multiplication is a subgroup, $G$ is a subgroup of $S_{|G|}$.
This proof also shows that we can weaken the right cancellation hypothesis with:
If $g$, $h \in G$ satisfy $gx = hx$ for all $x \in G$, then $g = h$.