Prove that $\det(xI_m-AB)=x^{m-n}\det(xI_n-BA)$
Let $r=\operatorname{rank}(A)$
From a well-known theorem, derive that there exists $P,Q$ invertible $m\times m$ and $n \times n$ matrices such that $$A=P\begin{bmatrix}I_r& 0\\ 0 &0\end{bmatrix}Q $$
where $I_r$ denotes the $r\times r$ identity matrix.
By changes of basis, $$B=Q^{-1}\begin{bmatrix}E& F\\ G &H\end{bmatrix}P^{-1}$$
For some submatrices $E,F,G,H$.
Note that $AB=P\begin{bmatrix}E& F\\ 0&0\end{bmatrix}P^{-1}$ and $BA=Q^{-1}\begin{bmatrix}E& 0\\ G&0\end{bmatrix}Q$.
Hence $\chi_{AB}=\det(E-XI_r)(-X)^{m-r}$ and $\chi_{BA}=\det(E-XI_r)(-X)^{n-r}$
Hence $\chi_{BA}=(-X)^{n-m}\chi_{AB}$.
This proof is nothing new. It is a reformulation of Sylvester's determinant theorem as suggested in Fabian's comment.
Assume $x \ne 0$, we have
$$ \begin{bmatrix}I_n & B\\ A & xI_m\end{bmatrix} \begin{bmatrix}I_n & -B\\ 0 & I_m\end{bmatrix} = \begin{bmatrix}I_n & 0\\ A & xI_m - AB\end{bmatrix}$$ This implies $$\det(xI_m - AB) = \begin{vmatrix}I_n & 0\\ A & xI_m - AB\end{vmatrix} =\begin{vmatrix}I_n & B\\ A & xI_m\end{vmatrix}\tag{*1} $$ Notice $$\begin{vmatrix}I_n & B\\ A & xI_m\end{vmatrix} = (-)^{mn} \begin{vmatrix}A & xI_m\\I_n & B\end{vmatrix} = \begin{vmatrix}xI_m & A\\B & I_n\end{vmatrix} = x^{m+n}\begin{vmatrix}I_m & x^{-1}A\\x^{-1}B & x^{-1}I_n\end{vmatrix} $$ Apply $(*1)$ with $x^{-1}B, x^{-1}A, x^{-1}I_n$ taking the roles of $A, B, xI_m$, we get
$$\begin{align}\det(xI_m-AB) &= x^{m+n}\det(x^{-1}I_n - x^{-2}BA) = x^{(m+n)-2n}\det(x I_n - BA)\\ &= x^{m-n}\det(xI_n - BA)\end{align}$$
This leave us with the special case $x = 0$,
- if $m = n$, the relation at hand reduces to $\det(-AB) = \det(-BA)$ which is trivially true.
- if $m > n$, LHS reduces to $\det(-AB)$ where $AB$ is a $m \times m$ matrix. Since the rank of $A$ and $B$ is at most $n < m$, this determinant is zero. RHS is zero because of the $x^{m-n}$ factor.
Combine all these, we have
$$\det(x I_m - AB ) = x^{m-n} \det(x I_n - BA)$$
unless $x = 0$ and $m < n$ where the RHS is an undefined expression.