Proving that if $AB=A$ and $BA=B$, then both matrices are idempotent Let $A, B$ be two matrices such that $AB=A$ and $BA=B$, how do I show that $A\cdot A=A$ and $B\cdot B=B$?
Steps I took:


*

*Let $A= \left[\begin{array}{rr} 
    a & b \\
    c & d \\
   \end{array}\right]$ and let $B= \left[\begin{array}{rr} 
    w & x \\
    y & z \\
   \end{array}\right]$ 

*$\left[\begin{array}{rr} 
    a & b \\
    c & d \\
   \end{array}\right] \cdot \left[\begin{array}{rr} 
    w & x \\
    y & z \\
   \end{array}\right] = \left[\begin{array}{rr} 
    aw+by & ax+bz \\
    cw+dy & cx+dz \\
   \end{array}\right] $ (Which is also equal to A)

*$\left[\begin{array}{rr} 
    w & x \\
    y & z \\ 
   \end{array}\right] \cdot \left[\begin{array}{rr} 
    a & b \\
    c & d \\
   \end{array}\right] = \left[\begin{array}{rr} 
    wa+xc & wb+xd \\
    ya+zc & yb+zd \\
   \end{array}\right] $ (Which is also equal to B)
At this point I am stuck. I don't know how to proceed and I imagine that I started off on the wrong track to begin with. I'd like a hint to guide me in the right direction.

My proof after consultation with answerers below:
Proof:
1) Since $AB=A$, we can say that: $(AB)A=AA$ which is equal to $A^2$
2) Then, (by associativity of matrix multiplication), we can say that $A(BA) = AB$ (since $BA=B$)
3) Then, $AB=A$ (since $AB=A$ was given)
4) Therefore, $AA$ is equal to $A$
5) Since $BA=B$, we can also say that: $(BA)B=BB$ which is equal to $B^2$
6) Then, (by associativity of matrix multiplication) we can say that $B(AB)=BA$ (since $AB=A$)
7) Then, $BA=B$
8) Therefore, $BB$ is equal to $B$
9) Thus, $AA$ is equal to $A$ and $BB$ is equal to $B$
Q.E.D.

Since $AB=A$ and $BA=B$, to show that $A$ is an idempotent we have to show that $A=A^2$
Therefore $A^2=(AB)^2 = A^2B^{ } = AB = A(BA) = AA = A^2 = A$. Proven
