Suppose we have a set with an associative operation, but we don't know the set is a group. Therefore no simplifications are possible. We want to prove that if there exists $n \geq 2$ such that for any two elements $x,y$ in the set we have $(xy)^n = yx$, then the operation is commutative.
We can prove pretty fast that all the squares commute. Just multiply with $x$ in the right side and get $$ yx^2 = (xy)^nx=x(yx)^n = x^2y$$
Then it is possible to prove that for $n$ even we have the desired conclusion. We have $(xy)^{n^2}=xy$ so if $n = 2k$ then $$ xy = (xy)^{4k^2} = x(yx)^{2k^2}yxyx... = (yx)^{2k^2}(xy)^{2k^2}$$ since in the last expression we can commute the terms, which are squares, we may permute $x$ and $y$. The same trick does not work for $n$ odd, and for the moment I cannot find a good working argument.
How would you solve this problem?