I would be grateful if someone pointed out an error in my answer.
Prove that a if finite set $G$ is closed under an associative product and that both cancellation laws hold in $G$, then it is a group. Also prove that if only one cancellation law holds, then $G$ need not be a group.
In my proof, I seem to be using only one of the cancellation laws. Hence it is a contradiction to both parts of the question.
Proof: Take an element $a\in G$. Find $a^n$ for all $n\in\Bbb{N}$. We know $G$ is closed under multiplication, and that it is also finite. Hence, there has to be some $a^x=a^y$. Using the left hand cancellation law, we get $a^{x-y+1}=a$, which implies $a^{x-y-1}$ is the inverse of $a$ ($a.a^{x-y}=a\implies a.a^{a-y-1}=e$).
Now we have to prove that the inverse of $a$ exists in $G$. Let us suppose it is $x$. Assumption: if $x$ is the inverse of $a$, then $axa=a$. Using the left cancellation law, suppose we find $a^m=a$. Then $x=a^{m-2}$. As $G$ is closed under multiplication, $x\in G$. Here I'm assuming $m\geq 3$.
Hence, $G$ is a group.
Are the assumptions (if $ax=a\implies x$ is the identity and $axa=a\implies x$ is the inverse) valid?
Thanks in advance!