Solution (source code)

= Solution

For each triangle compactly contained in $U$, part (i) permits the interchange of the series and its boundary integral. <Cauchy's integral theorem> makes every term zero. The uniform limit is continuous, so <Morera's theorem> yields that $f$ is holomorphic on $U$.

For the final application, each function $(z-k)^{-2}$ is holomorphic away from its pole. Fix a positive integer $n$. For $z\in U_n$ and $k>2n$,
$$
|z-k|\geq k-|z|>k-n\geq k/2,\qquad
\left|\frac1{(z-k)^2}\right|\leq\frac4{k^2}.
$$
The numerical series $\sum_{k>2n}4/k^2$ converges, so the <Weierstrass M-test> gives <uniform convergence> of the tail on $U_n$. Adding the finitely many initial terms preserves <uniform convergence>. Those initial terms need not be bounded near their excluded poles; only the tail needs the uniform bound. By the first conclusion, the full sum is holomorphic on each $U_n$. Their union is $\mathbb C\setminus\mathbb N$, hence
$$
\boxed{\sum_{k=1}^\infty\frac1{(z-k)^2}\text{ is holomorphic on }\mathbb C\setminus\mathbb N.}
$$