First time post. I am looking at a question that should seem very simple. It is stated as follows:
Let $A$ and $B$ be matrices.
Show that if $AB = A$ and $BA=B$
then $A^2=A$ and $B^2=B$.
I have tried a few different approaches. 1) If $A=AB$ then $$A^2=(AB)^2$$ $$A^2=(AB)(AB)$$ $$A^2=A(BA)A $$ $$A^2=ABA$$ But I didnt get anywhere and I am not sure if I can use associativity in line 3.
2) Then I thought what about if we approached it like somewhat like this $$(A+B)^2=A^2+AB+BA+B^2$$
Then the $AB=A$ and $BA=B$ can be used so $$(A+B)^2=A^2+A+B+B^2$$ then maybe you can set $A^2+A$ to zero (maybe??) and $B+B^2$ to zero (maybe??). But this doesnt give me something nice so what about if we tried expanding the expression $$(A-B)^2=A^2+AB-BA+B^2$$ $$(A-B)^2=A^2+A-B+B^2$$ Then we would be able to set $A^2+A$ to zero (maybe??) and $-B+B^2$ to zero (maybe??). Then at least part of it would make sense. i.e. $$-B+B^2=0$$ $$B^2=B$$
Would really appreciate some help if possible.
Suppose $AB=A$ and $BA=B$.Then $A^2=AA=(AB)A=A(BA)=AB=A$. And $B^2=BB=(BA)B=B(AB)=BA=B$ and done.