<s>[INST] Associative Property What I learn as a basic theory of associative is that $$(a \times b) \times c = a \times (b \times c) \text{ and } (a+b)+c = a+(b+c).$$
However when doing my exercises on this topic, I came across questions with only 2 variables. Eg. $a^2+b^2$. Is this associative and why?
The binary operation is given as $a * b = a^2 + b^2$.
 [/INST] For $a\ast b$ to be associative it should be
$$(a\ast b)\ast c=a\ast (b\ast c),\text{ for all }a,b,c\in \Bbb R,\tag{1}$$
since I assume we are discussing a sum of squares of real numbers. This is, it should be
$$(a^2+b^2)^2+c^2=a^2+(b^2+c^2)^2,\ \forall a,b,c\in \Bbb R.$$
But now it's not difficult to find a counterexample to the above equality:
$$(0^2+1^2)^2+2^2=(0+1)^2+2^2=1^2+2^2=1+4=5$$
while
$$0^2+(1^2+2^2)^2=0+(1+4)^2=0+5^2=0+25=25.$$
Since $(0\ast 1)\ast 2\ne 0\ast (1\ast 2)$, $(1)$ does not hold, this is
$$a\ast b:=a^2+b^2$$
is not associative over the real numbers (and it is not over any subset of reals containing $0$, $1$ and $2$, like $\Bbb Q$ or $\Bbb N$).
</s>