Solution (source code)

= Solution

For $X_i=k/U_i$, the indicator is always one, and the <importance weight> reduces to
$$
\frac{f(X_i)}{g(X_i)}=\frac{X_i^2}{\pi k(1+X_i^2)}=\frac{k}{\pi(U_i^2+k^2)}.
$$
Averaging these independent contributions gives
$$
\boxed{\widehat\mu=\frac1n\sum_{i=1}^n\frac{k}{\pi(U_i^2+k^2)}.}
$$
As a direct normalization check, its <expectation> is $\int_0^1 k/[\pi(u^2+k^2)]\,du=\pi^{-1}\arctan(1/k)$. For $k>0$ this equals $1/2-\pi^{-1}\arctan k$, the exact standard <Cauchy distribution> tail <probability>. The substitution $X=k/U$, rather than $k/(1-U)$ with the same symbol left unchanged, explains why the displayed denominator contains $U^2$.