I was sitting in an algebra course a year ago and while commutativity and associativity were discussed I wondered:
Does there exist a set $S$ with an operation $\cdot$ which is commutative, has an identity $e$, and where every element has an inverse, but where the operation is not associative?
I jotted down some things and came upon a relatively short proof concluding that if such a set exists, it must satisfy the property that $x^2=e$ for every $x\in S$.
I didn't think much of it, but recently I thought about the problem again and tried extensively to recreate the proof, but I was not able to. I suspect that the original proof was incorrect, but at the same time, I have not been able to come up with a counterexample.
An example of such a structure is given below:
let $S=[0,\infty)$, with
$$x\cdot y := |x-y| $$
Clearly it is commutative, has identity $0$, and it is not associative, since
$$ \left|3-|2-2| \right| = 3 \neq \left| |3-2|-2\right| $$
But alas it does satisfy exactly $x\cdot x = 0$!
I also verified for sets of $3$ elements that commutativity and inverses force associativity, but I have not made any progress towards a general solution, besides the "proof" from a year ago that I can't remember. If anyone has some ideas or insight, it would be greatly appreciated