TITLE: Homology groups and inclusions
QUESTION [5 upvotes]: Let $X \subset \mathbb{R}^n$ be compact. Suppose that $\mathbb{R}^k \setminus (X \cap\mathbb{R}^k)$ is not connected for some $k < n$. Does it imply that $X$ has nontrivial homology groups?
edited: add an assumption that  $k > 1$ (otherwise it is false as mantioned below)

REPLY [2 votes]: One can again find a counter example of your conjecture :
Let $X=\{(x,y,z)\in \mathbb R^3: x^2+y^2+z^2=1, z\leq 0\}\subset \mathbb R^3$ be the south hemisphere. This is a compact subset of $\mathbb R^3$ homeomorphic to a closed disk thus having trivial homology groups. 
But for any $k\in (-1,0]$, the intersection of the hyperplane $H_k=\{(x,y,z)\in \mathbb R^3: z=k\}\subset \mathbb R^3$ and $X$ is a circle. So $H_k\backslash (H_k\cap X)$ looks like a plane minus a circle which is not connected.