Q:

Is there a binary operation $*$ such that $(a*a)*a\neq a*(a*a)$?

Q: Is there a binary operation $*$ such that $(a*a)*a\neq a*(a*a)$?

I apologize if this question has been asked before or maybe it is too stupid. 
It is not obvious to me that any binary operation always must satisfy $(a*a)*a= a*(a*a)$. I tried to find counterexamples, but so far no luck.
Certainly this binary operation, if it exists, is not associative.

A:

Consider the integers $\mathbf{Z}$ and the binary operation $n * m = n-m.$
Then
$$ (n*n)*n=(n-n)-n=-n$$
but
$$ n*(n*n)=n-(n-n)=n$$
for all $n.$

A:

Division (in, say, the nonzero reals) provides another example: $${a\over ({a\over a})}=a\quad\mbox{but}\quad{({a\over a})\over a}={1\over a}$$ 

A:

I would also keep in mind, that a binary operation can be anything, as long as it takes two elements and maps them onto one element (which again is in whatever set you are defining your operation in).  
F.ex. for the set $\{a,b\}$ you could define $a\times a:=b$ and $a \times b:=b$ but $b \times a:=a$.
On the one hand you would get $a$ and on the other $b$.
Of course in this case you can just take a 'normal' example, like stated in the other answers.

