For all square matrices $A$ and $B$ of the same size, it is true that $(A+B)^2 = A^2 + 2AB + B^2$?

A counterexample is all you need, so you're done. You probably could have picked a simpler counterexample, say with most entries of $A$ and $B$ being $0,$ but yours works just fine.

As an alternative, note that if $A$ and $B$ are square matrices of the same size, then $$(A+B)^2=A(A+B)+B(A+B)=A^2+AB+BA+B^2.$$ From this, it follows that $$(A+B)^2=A^2+2AB+B^2$$ if and only if $AB=BA.$ So, any two square matrices $A,B$ of the same size such that $AB\neq BA$ will yield a counterexample.


$$\begin{align*} (A+B)^2 &= (A+B)(A+B) \\ &= AA+AB+BA+BB \\ &= A^2 + AB+BA+B^2.\end{align*}$$

Is it always true that $AB+BA = 2AB$?