Show that $G$ is a group if the cancellation law holds when identity element is not sure to be in $G$ Having already read through show-that-g-is-a-group-if-g-is-finite-the-operation-is-associative-and-cancel, however in Herstein's Abstract Algebra, I was required to prove it when we're not sure if identity is in the set.
If $G$ is a finite set close under an associative operation such that $ax=ay$ forces $x=y$ and $ua=wa$ forces $u=w$, for every $a, x, y, u, w\in G$, prove that $G$ is a group.
How to show it then? I have no idea what to do at all.

The key here is $G$ being finite, so you can use the pigeonhole principle. Take some $a\in G$ and look at the set
$$A=\{\, ab \mid b \in G\, \} \subseteq G.$$


*

*If $a\in A$, then $ab=a$ for some $b$.

*If $a\notin A$, then $A\subsetneq G$, so two of the products have to coincide, since $G$ is finite (pigeonhole principle). So we have $b\neq b'$ with $ab=ab'$. Since cancellation laws hold we conclude $b=b'$, a contradiction.


So for every $a\in G$ we always have some $b\in G$ such that $ab=a$.
Can you take it from here?
