<s>[INST] Commutative matrix 
*

*If two matrices $A$ and $B$ are commutative then all rules for real numbers $a$ and $b$ apply for the matrices?
For example, if $AB=BA$ then:
$(A+B)^2=A^2 + 2AB + B^2$
$A^3 - B^3 = (A-B)(A^2+AB+B^2)$
and so on...


*If the matrix $A$ is invertible then is $A^m  A^n = A^{(m+n)}$, where $m,n$ are integers?
 [/INST] *

*"Do all rules for real numbers apply to the matrix?"
If by all rules for real numbers, you mean finite factorization laws like in your two examples, then yes. How might we prove such a thing? Let's consider $(A + B)^2$ and $(A+B)^3$.
$(A + B)^2 = A^2 + AB + BA + B^2$, and as $AB = BA$ we can write this as $A^2 + 2AB + B^2$. Similarly, once we write out $(A^2 + 2AB + B^2)(A + B)$, we can simply commute the matrices to get that $(A+B)^3 = a^3 + 3A^2 B + 3AB^2 + B^3$, and so on.
If by all rules for real numbers, you actually mean all rules for real numbers, then the answer is no. For example, it's not true that a matrix A satisfies the trichotomy, $A > 0, A = 0,$ or $A<0$.

*"If matrix $A$ is invertible, then is $A^m A^n = A^{m+n}$ for $m,n \in \mathbb{Z}$?"
Let's look at a case. Suppose $m = 2, n = -3$. Then $A^2 A^{-3}$ makes sense. And $A^2A^{-3} = A(AA^{-1})A^{-2} = (AA^{-1})A = A$. Do you see how this proof might be expanded? In fact, for a general matrix $B$, $B^m B^n = B^{m +n}$ if $m,n > 0$, so the important detail here is whether or not $A^{-1}$ makes sense to write down.
</s>