How to show that two matrices have same eigenvalues? [duplicate]

Consider $4$ square matrices $A_{i,j}$ for $i,j\in \{1,2\}$. Suppose $A_{1,1}$ and $A_{2,2}$ are invertible.

Consider $$B:=A_{2,1}A^{-1}_{1,1}A_{1,2} A_{2,2}^{-1}$$ and $$C:=A_{1,2}A^{-1}_{2,2}A_{2,1} A_{1,1}^{-1}$$ I have done some checks and it seems to me that $B$ and $C$ have the same eigenvalues (even if in different orders). How can I show this?

It suffices to show that if $U$ and $V$ are two matrices of size $n\times m$ and $m\times n$, respectively (in your case perhaps you assume $n=m$?), then $UV$ and $VU$ have the same non-zero eigenvalues (and strictly the same eigenvalues if $n=m$). To see this assume $\lambda\in {\Bbb C}\setminus \{0\}$ and that $$0 \neq x\in \ker (UV -\lambda) \subset {\Bbb C}^m.$$ Then $VU (Vx) = V (UV x)= \lambda Vx \neq 0$ so $\ker(VU -\lambda) \neq \{0\}$. After a bit more work one may also show that the algebraic multiplicity of $\lambda$ agrees for the two products. Alternatively one may also show that their caracteristic polynomials are identical (if $n=m$) or differs by a factor $\lambda^{|n-m|}$ in the general case.