I was given this question and the proof.
Let $G$ be a nonempty set and let $*$ be an associative binary operation on $G$. Assume that both the left and right cancellation laws hold in $(G,*)$.
Assume moreover that $G$ is finite. Show that $(G,*)$ is a group.
My question is why does the set have to be finite? What would happen if its the opposite?