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
If you think about it, start with an arbitrary set $S$ with a binary operation. No identity? Let's just add one to it. No inverse for $a$? Again just add one and call it $a^{-1}$. Then there comes the potential problem: what is $a^{-1}b$? or even $a^{-1}a^{-1}$? Well, since associativity isn't enforced, identity and inverses don't talk to other products hence it can be anything you want!
Here is a minimal example: $S=\{e, a, b\}$ with multiplication table: $$ea=ae=a, eb=be=b, ee=e$$ that is $e$ is the identity.
$$ab=ba=e$$ that is $a$ and $b$ are inverses of each other.
$$aa=a, bb=b$$ which kills the associativity and $x^2=e, \forall x$.
The moral is without associativity, identity and inverse don't mean much. That's why in category theory, almost nothing but associativity is assumed.