Definition 1$\quad$ A metric space $E$ is connected if it cannot be written as the union of two nonempty separated sets (in $E$).
Definition 2$\quad$ A metric space $E$ is connected if it cannot be written as the union of two nonempty disjoint open (relative to $E$) sets.
Clearly the former implies the latter. But I don't know how the latter implies the former, since "separated sets" are too general a category and can be very complicated.
Is there a basic proof to this? Thanks in advance!
PS: Things I know are some basic properties about closed, open, compact, perfect sets etc. in metric spaces.
You have to interpret open as relatively open in $X$, since $X$ need not be open in the space.
Suppose that $X=A\cup B$, where $A$ and $B$ are non-empty and separated. Then $A\cap\operatorname{cl}B=\varnothing$, so
$$B\subseteq\operatorname{cl}_XB=X\cap\operatorname{cl}B\subseteq X\setminus A=B\;,$$
and it follows that $\operatorname{cl}_XB=B$. Thus, $B$ is relatively closed in $X$, and $A=X\setminus B$ is relatively open in $X$. A similar argument shows that $B$ is relatively open in $X$. Thus, Definition 2 implies Definition 1.
Note that I did not use the fact that the space is metric: the argument works in any topological space.