Show that $|I_m-AB|=|I_n-BA|$ [duplicate]
Hint.
Compute the product of the block matrices $$ \pmatrix{I_m & A \\ 0 & I_n} \pmatrix{I_m - AB & 0 \\ B & I_n} \pmatrix{I_m & -A \\ 0 & I_n}.$$
This somewhat mystifying calculation can be thought of as performing different "block" row and column operations on the matrix $\pmatrix{I_m & A \\ B & I_n}$, which don't change the determinant.
That is, $$\pmatrix{I_m & -A \\ 0 & I_n} \pmatrix{I_m & A \\ B & I_n}$$ subtracts $A$ times the bottom row from the top row, while $$ \pmatrix{I_m & A \\ B & I_n} \pmatrix{I_m & -A \\ 0 & I_n}$$ subtracts the first column times $A$ from the second column. The two different ways of eliminating the $A$ lead to two different triangular block matrices with the same determinant.
Another way of approaching this: define $$ C = \pmatrix{I&A\\B&I}, \quad D = \pmatrix{I&-A\\0&I} $$ and note that $\det(CD) = \det(DC)$.