A very well-known formula in complex analysis is
$ \lim_{\epsilon\to0^+}\int_{-\infty}^\infty\frac{f(x)}{x-x_0\pm i\epsilon}dx = P\int_{-\infty}^\infty \frac{f(x)}{x-x_0}dx \mp i\pi f(x_0), $
known as Sokhotski–Plemelj theorem. I am really puzzled by the meaning of the integral on the left hand side. I understand that this integral comes from an integral over an infinite arc of radius $R$ on the upper-half plane (where the integral goes to zero for $R\to\infty$) plus the real line (after taking the limit $\epsilon\to 0$). Assuming the integrand goes to zero faster than $x^{-1}$ and considering the residue theorem, we get the result:
$ \lim_{\epsilon\to0^+}\int_{-\infty}^\infty\frac{f(x)}{x-x_0\pm i\epsilon}dx=2\pi i \text{Res}[f;x_0]. $
Now, if we take the minus sign for $i\epsilon$ and send $\epsilon$ to 0 (without calculating the integral) the above equation yields $2\pi if(x_0)$, while the plus sign yields 0. What is the problem here? Is this related to the fact I can't commute the limit with the integral sign in this case, i.e.
$ \lim_{\epsilon\to0^+}\int_{-\infty}^\infty\frac{f(x)}{x-x_0\pm i\epsilon}dx\neq\int_{-\infty}^\infty\frac{f(x)}{x-x_0}dx? $