Suppose that one has two matrices $A$, $B$. Then
Prove that $$|AB - \lambda I| = |BA - \lambda I|,$$ where $|\cdot|$ denotes the determinant, $I$ - identity matrix and $\lambda \in \mathbb{C}$.
Note that $A$ and $B$ are not necessary invertible. For invertible matrices I easily found $$|AB - \lambda I| = |B(AB - \lambda I)B^{-1}| = |BA - \lambda I|.$$
I'm aware of three proofs. The first is the one you get by combining your argument with Marko's comment. The second is to show that $AB$ and $BA$ have the same non-zero eigenvalues with the same multiplicities. The third proof runs as follows. Set \[ M=\begin{pmatrix}I&A\\ B&I\end{pmatrix},\quad N=\begin{pmatrix}I&0\\-B&I\end{pmatrix} \] and then note that \[ MN=\begin{pmatrix}I-AB&A\\0&I\end{pmatrix},\quad NM=\begin{pmatrix}I&A\\0&I-BA\end{pmatrix}. \] Since $\det(MN)=\det(NM)$, the result follows.
One advantage of the third proof is that it works for matrices over a commutative ring.