Proof (connected subset of a disconnected space)

$U$ and $V$ are disjoint and open in $X$. Note that $$ \begin{align*} Y = X\cap Y = (U\cup V) \cap Y = (U \cap Y) \cup (V \cap Y) \end{align*} $$ where $U\cap Y$ and $V\cap Y$ are disjoint and is open in $Y$. Since $Y$ is connected, one of them has to be empty.