A Problem from Zorich's Analysis II - Connectedness Here is the problem (It's from English edition - Section 9.4.1 Exercise 1.b)):

Show that in terms of the ambient space the property of connectedness
  of a set can be expressed as follows: A subset $E$ of a topological
  space $(X, r)$ is connected iff there is no pair of open
  (or closed) subsets $G^{ '}_x$, $G^{''}_x$ that are disjoint and such 
  that $E\cap G^{'}_x \neq\emptyset$, $E\cap  G^{''}_x \neq \emptyset$, and $E \subset (G^{'}_x \cup G^{''}_x)$.

It is obvious that, if there is such pair of sets $G^{ '}_x$, $G^{''}_x$ then $E$ is not connected. The problem is to prove that, if $E$ is not connected, then there must be such pair of sets. 
My reasoning is as follows. Since $E$ is not connected, there are two disjoint open and non-empty sets $G^{'}_E$,$G^{''}_E$. Then there are also open sets $G^{ '}_x$, $G^{''}_x$ such that $G^{ '}_x \cap E =G^{'}_E$, $G^{''}_x \cap E = G^{''}_E$. $G^{ '}_x$ and $G^{''}_x$ are disjoint within $E$, so to speak, but how to prove their disjoint'dness in $X\setminus E$ ??
 A: For the pair of open sets, and if the ambient space is metrizable, you can do this as follows.
Assume $E$ is not connected and let $G_E$, $G'_E$ be as above. Let also $d$ be a metric on $X$ compatible with the topology. Define $G_X=\{ x\in X;\; {\rm dist} (x,G_E)<{\rm dist} (x,G'_E)\}$ and $G'_X=\{ x\in X;\; {\rm dist} (x,G_E')<{\rm dist} (x,G_E)\}$, where ${\rm dist}$ is relative to the metric $d$.
The sets $G_X$ and $G'_X$ are open in $X$ because the function ${\rm dist}$ is continuous; and obviously $G_X\cap G'_X=\emptyset$. It is enough to show that $G_E\subset G_X$ and $G'_E\subset G'_X$. (Since $E=G_E\cup G'_E$ and $G_X\cap G'_X=\emptyset$, this will give $E\cap G_X=G_E$ and $E\cap G'_X=G'_E$).
Let $x\in G_E$. Then ${\rm dist}(x,G_E)=0$. Moreover, we cannot have ${\rm dist}(x,G'_E)=0$, because this would mean that $x$ is in the closure of $G'_E$ (relative to $X$), hence in the closure of $G_E'$ relative to $E$ since $x\in E$, i.e. in $G'_E$ since $G'_E$ is closed in $E$. So ${\rm dist}(x,G'_E)>0$, and hence $x\in G_X$. Likewise, $G'_E\subset G'_X$.
For a non-metrizable ambient space $X$, I don't know how to prove the result.
Actually, as Daniel's and Brian's examples show, you cannot prove it in an arbitrary topological space.
A: The result is false in general. Let $X$ be any non-normal space, and let $H$ and $K$ be disjoint closed subsets of $X$ that do not have disjoint open nbhds. Let $Y=H\cup K$. In $Y$ the sets $H$ and $K$ are disjoint and clopen, so $Y$ is not connected. However, if $U$ and $V$ are open sets in $X$ such that $U\cap Y=H$ and $V\cap Y=K$, then $U\cap V\ne\varnothing$.
If $X$ is $T_4$, the result holds when $Y$ is a closed subspace of $X$. Suppose that $Y=H\cup K$, where $H$ and $K$ are relatively open in $Y$. Define $$f:Y\to\{0,1\}:x\mapsto\begin{cases}0,&\text{if }x\in H\\1,&\text{if }x\in K\;.\end{cases}$$ Then $f$ is continuous and by the Tietze extension theorem can be extended to a continuous $g:X\to[0,1]$. The inverse images under $g$ of $\left[0,\frac12\right)$ and $\left(\frac12,1\right]$ are then disjoint open sets in $X$ separating $H$ from $K$.
The correct general result is that $Y$ is connected iff it cannot be written as the union of two non-empty sets that are separated in $X$, where $H$ and $K$ are said to be separated in $X$ if $H\cap\operatorname{cl}K=K\cap\operatorname{cl}H=\varnothing$.
Added: It’s a standard result that $X$ is hereditarily normal iff whenever $H$ and $K$ are separated sets in $X$, there are disjoint open sets $U$ and $V$ in $X$ such that $H\subseteq U$ and $K\subseteq V$. Thus, the result in the question holds for all subsets of $X$ iff $X$ is hereditarily normal.
A: Let $X = \mathbb{R} \cup \{\ast\}$, where $\ast$ is an entity that is not a real number. Let $\mathcal{T}_s$ the standard topology on $\mathbb{R}$, and let
$$\mathcal{T} = \{\varnothing\} \cup \{ U \cup \{\ast\} : U \in \mathcal{T}_s\}.$$
$\mathcal{T}$ is a topology on $X$.
Let $E = (-1,0) \cup (0,1)$. The subspace topology on $E$ induced by $\mathcal{T}$ is the same as the topology induced by $\mathcal{T}_s$, the standard topology, so $E$ is not a connected topological space.
But any two nonempty open sets in $X$ have nonempty intersection (the intersection contains $\ast$), hence there are no two nonempty disjoint open sets $U_1,\,U_2$ with $E \subset U_1 \cup U_2$.
Also, the closed sets in $X$ are, apart from the entire space, the standard-closed subsets of $\mathbb{R}$, so if $E \subset F_1 \cup F_2$ with closed $F_1$, $F_2$ such that $F_1\cap E \neq\varnothing \neq F_2\cap E$, then $F_1 \cap F_2 \neq \varnothing$. (The subspaces $(-1,0)$ resp. $(0,1)$ of $E$ are connected, hence if e.g. $F_1 \cap (-1,0) \neq \varnothing$, then $(-1,0) \subset F_1$, and hence $0 \in F_1$, ditto for $(0,1)$.)
