Let $Y$ be a nonempty closed subset of $X \subset \Bbb R^n$. Assume $X\setminus Y = A\cup B$, with $A,B \subset X$ nonempty, open and disjoint. Prove $Y\cup A$ and $Y\cup B$ are connected. If $B$ is not open, show with a counterexample that $Y\cup B$ could be not connected.
I understand that $X\setminus Y$ is not connected, precisely, $(A, B)$ is a separation for $X\setminus Y$. I am trying to prove this by contradiction. I suppose $Y\cup A$ not connected, so, exists nonempty $C, D$ open in $Y\cup A$ and disjoint such that $Y\cup A = C\cup D$.
Also, $X=(Y\cup A)\cup B =(C\cup D)\cup B$, but I am stuck in this point. I tried to understand with some sketches but I have no idea how to use the fact $Y$ is closed.
I would really appreciate any help to take it from here.