Solution (source code)

= Solution

For $x>0$, the upper-bank argument tends to zero, whereas the lower-bank argument tends to $2\pi$. Thus
$$
\sqrt{x+i0}=\sqrt x,\qquad\sqrt{x-i0}=e^{i\pi}\sqrt x=-\sqrt x.
$$
The <analytic function> $f$ has identical boundary values across this part of the real axis. Hence the <branch cut> introduces a sign change:
$$
\boxed{\left.\frac{f(z)}{\sqrt z}\right|_{z=x-i0}=-\left.\frac{f(z)}{\sqrt z}\right|_{z=x+i0}.}
$$
This compares integrand values. When two contour segments traverse opposite banks in opposite directions, their orientation supplies an additional minus sign.