A square matrix $A$ is called idempotent if $A^2=A$.
(a) Suppose $A$ is an $n \times n$ idempotent matrix and let $I$ be the $n\times n$ identity matrix. Prove that the matrix $I-A$ is an idempotent matrix.
(b) Assume that $A$ is an $n\times n$ nonzero idempotent matrix. Then determine all integers $k$ such that the matrix $I-kA$ is idempotent.
(c) Let $A$ and $B$ be $n\times n$ matrices satisfying
\[AB=A \text{ and } BA=B.\]
Then prove that $A$ is an idempotent matrix.