# Is connectedness subspace invariant?

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?

I think that you misunderstood the definition of connectedness: A subset of a topological space $$Z\subseteq X$$ is disconnected if it can be divided into two nonenmpty disjoint open in $$Z$$ sets $$A_1,A_2$$.

Recall that a set $$A_i\subseteq Z$$ is open in $$Z$$ if there is an open in $$X$$ set $$B_i$$ such that $$A_i=B_i\cap Z$$.

It is not required for the definition of connectedness that also the sets $$B_i$$ are disjoint.

It is of course a valid question (though not directly related with the definition of connectedness) whether a space $$X$$ has the property that in such cases you can always choose even $$B_i$$ to be disjoint.

If you only consider closed subsets $$Z$$ it happens that this is the case if and only if the space satisfies the $$T_4$$ separation axiom.

For arbitrary subsets $$Z$$, it holds if (and probably only if) the space satisfies even the $$T_5$$ separation axiom.

Metric spaces satisfy all $$T_i$$ separation axioms.