Step 1: Plan:
We know two facts, $AB = A$ and $BA = B$. Each fact lets us swap a product for a single matrix. We use the swaps inside the squares.
Step 2: Work out $A^2$:
Write $A^2 = A \cdot A$. Swap the right-hand $A$ using $A = AB$? That leads back to $A \cdot AB$, which is no simpler. Swap the left-hand $A$ instead: $A^2 = (AB)A$. Matrix multiplication can be regrouped, so $(AB)A = A(BA)$. Now $BA = B$, so this is $AB$, and $AB = A$. Hence $A^2 = A$.
Step 3: Work out $B^2$:
Swap the left-hand $B$ using $B = BA$: $B^2 = (BA)B = B(AB)$. Since $AB = A$, this is $BA$, and $BA = B$. Hence $B^2 = B$.
Step 4: Conclude:
Both squares equal the matrix itself, so both matrices are idempotent. Every option with a not-equal sign for either square is ruled out. That leaves option 1.
Final Answer:
\(A^2 = A\) and \(B^2 = B\), which is option 1.
\[ \boxed{A^2 = A,\ B^2 = B} \]