For every matrix $A$, the matrix $$\bex \sex{\ba{cc} I&A\\ 0&I \ea} \eex$$ is invertible and its inverse is $$\bex \sex{\ba{cc} I&-A\\ 0&I \ea}. \eex$$ Use this to show that if $A,B$ are any two $n\times n$ matrices, then $$\bex \sex{\ba{cc} I&A\\ 0&I \ea}^{-1}\sex{\ba{cc} AB&0\\ B&0 \ea} \sex{\ba{cc} I&A\\ 0&I \ea}=\sex{\ba{cc} 0&0\\ B&BA \ea}. \eex$$ This implies that $AB$ and $BA$ have the same eigenvalues.(This last fact can be proved in another way as follows. If $B$ is invertible, then $AB=B^{-1}(BA)B$. So, $AB$ and $BA$ have the same eigenvalues. Since invertible matrices are dense in the space of matrices, and a general known fact in complex analysis is that the roots of a polynomial vary continuously with the coefficients, the above conclusion also holds in general.)
Solution. This follows from direct computations.