Exercise 15 from Hungerford: Algebra.
Let $G$ be a nonempty finite set with an associative binary operation such that for all $a,b,c\in G\,\,ab=ac \Rightarrow b=c$ and $ba=ca \Rightarrow b=c$. Then $G$ is a group. Show that this conclusion may be false if $G$ is infinite.
I've solved the first part, but I wasn't able to find a counter-example.
Thanks in advance!
HINT: Is there a familiar (infinite) set and commutative operation in which you know that $ab=ac$ implies $b=c$? It's an example you can really count on.