$$\text{If }f(x)=\sum_{1\le r\le n}\frac1{x-a_r}$$ where $a_i$s are real,
If one of the root of $f(x)=0$ is $p+iq,$
$$0=f(p+iq)=\sum_{1\le r\le n}\frac1{p+iq-a_r}\ \ \ \ (1)$$
Using Complex conjugate root theorem, $p-iq$ must be another root
$$\implies 0=f(p-iq)=\sum_{1\le r\le n}\frac1{p-iq-a_r}\ \ \ \ (2)$$
$$\text{Now, }\frac1{p-iq-a_r}-\frac1{p+iq-a_r}=\frac{2iq}{(p-a_r)^2+q^2}$$
$$(2)-(1)\implies 2iq\sum_{1\le r\le n}\frac1{(p-a_r)^2+q^2}=0\implies q=0$$
So, the roots of $f(x)$ can not have imaginary parts.
Now, we know, every polynomial equation having complex coefficients and degree $m\ge1$ has exactly $m$ roots.