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.
For each $a\in G$, the map $l_a\colon G\to G, x\mapsto ax$ is injective beacuse $$l_a(x)=l_a(y)\implies ax=ay\implies x=y.$$ As $G$ is finite, $l_a$ is a bijection. Pick $a\in G$ and let $e=l_a^{-1}(a)$. Then $ae=l_a(e)=a$ and hence for all $x\in G$ we have $ex=x$ because $aex=ax$. The element $e$ is left neutral. Doing the same trick with right multiplication $r_a\colon x\mapsto xa$, we obtain a right neutral $e'$. From $e'=ee'=e$ we find that $e$ is a (two-sided) neutral. Using bijectivity of multiplication again, we find that each $x\in G$ has a left and a right inverse $e=xl_x^{-1}(e)$ and $e=r_x^{-1}(e)x$, which are in fact the same because $x=ex=xl_x^{-1}(e)x$ and $x=xe=xr_x^{-1}(e)x$.