If $X$ is a topological space and $Y$ is a subspace of $X$, then is it true that any subset $Z$ of $Y$ which is connected in the topology of $X$, is also connected in the subspace topology of $Y$?
I believe it is not true.
Explanation: Consider $X$ to be the topological space $\mathbb{R}$ equipped with the cofinite topology. Let $Y=\{1,2,3\}$ and $Z=\{1,2\}$. Then the subspace topology on $Y$ is the discrete topology, as $\{1\}=\{2,3\}^c\cap Y$, and so on. Therefore, $Z$ is not connected in the subspace topology of $Y$. However $Z$ is connected in the topology of $X$, as any two open set in $X$ have non-empty intersection.
However, is my query true for metric spaces? If so, what property of a metric space ensures such a nicety?
Thanks in advance!