Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I am sorry to have omitted the condition $U\supset K$, this makes the question looks rather stupid. But I must say that this is not a homework question, this is a claim (without proof) in a proof of a paper I am reading. I don't think it is completely trivial, as this is false if we replace Rn with some other connected spaces, such as the torus. Therefore somehow we must use the property of $\mathbb{R}^n$ (e.g. Jordan's theorem), but I have no idea how to. Perhaps it's also interesting to see if we can replace $\mathbb{R}^n$ with other spaces, e.g. spheres.
I am not very familiar with relative homology, but I think we need more than that. I can only see that if $H_0(U, U-K)=0$, the inclusion induces a surjective map from $H_0(U-K)$ to $H_0(U)$, by the long exact sequence of relative homology. (Correct me if I am wrong. ) Also, if your argument is correct, doesn't it imply that if $K$ is the equator of the torus $T^2$, and $U$ is a tubular neighborhood of $K$, then $U-K$ is connected?