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.
With the Sylvester determinant identity, we have $$ \begin{aligned} \det\left(I_n + \left( X\frac 1{A - zI_m}\right)X^*\right) &= \det\left(I_m + X^*\left( X\frac 1{A - zI_m}\right)\right) \\ & =\det\left(I_m + \big(X^*X \big) \frac 1{A - zI_m}\right) \\ & =\det\left(\big(A - zI_m + X^*X\big)\frac 1{A - zI_m}\right) \\ & =\frac{\det\Big(\big(A + X^*X\big) - zI_m)\Big)}{\det(A - zI_m)}. \end{aligned} $$