Let $X \in \mathbb{C}^{n \times m} $ be a rectangular matrix of full rank, and $X^*$ its hermitian conjugate, let $A \in \mathbb{C}^{m \times m}$ a square matrix, and let $f: \mathbb{C} \to \mathbb{C}$ be defined by $$ f(z) = \det \left( I_n + X \frac{1}{A - z I_m} X^* \right) $$ where $I_n$ is the $n \times n$ identity matrix.
Show that for $n \leq m$ solutions of $f(z)= 0$ are given by $z$ equal to an eigenvalue of $B : = A + X^* X$.
My attempt: for $n = m$, $f(z)$ can be straightforwardly rearranged to $$ f(z) = \det \left( X \frac{1}{B-A} \big( B - I_m z \big) \frac{1}{A - z I_m} X^* \right) = \frac{\det(X) \det(B - I_m z) \det(X^*)}{\det(A - z I_m) \det(B - A)} $$ where the desired result follows from the factor $\det(B - I_m z)$.
However I cannot factorise the determinant in this way for $n < m$, and I am unsure how to proceed.