Cancellable Finite Semigroup is Group

Theorem
Let $$\left({S, \circ}\right)$$ be a finite semigroup in which all elements are cancellable.

Then $$\left({S, \circ}\right)$$ is a group.

Proof
Choose $$a \in S$$. Let the mapping $$\lambda_a$$ be the left regular representation of $$\left({S, \circ}\right)$$ with respect to $$a$$.

Because all elements are cancellable, in particular, so is $$a$$, so $\lambda_a$ is injective.

As $$S$$ is finite, $\lambda_a$ is also surjective.

Hence $$a \circ e = a$$ for some $$e \in S$$.

Let $$x \in S$$. Then because of cancellability:

Thus $$e$$ is the identity.

The existence of inverses comes from the surjectivity of $$\lambda_a$$.

Comment
Note that the same does not apply to infinite semigroups.

Consider the semigroup $$\left({\mathbb{N}, +}\right)$$.
 * It is closed: the sum of two natural numbers is another natural number.
 * Addition is associative, so it is definitely a semigroup
 * $$b + a = c + a \Longrightarrow b = c$$, so all elements of $$\left({\mathbb{N}, +}\right)$$ are cancellable.

But $$\left({\mathbb{N}, +}\right)$$ is not a group, as (apart from $$0$$) no element has an inverse.