Remark:
I am aware that in a metric space, the existence of a countable base is equivalent to separability. Therefore, one could argue(Every subspace of a separable metric space is separable) that since $X$ has a countable base, $Y$ must also have a countable base (as the open sets in $Y$ are just intersections of open sets in $X$ with $Y$), and hence $Y$ is separable. However, this proof seems indirect, and I am interested in finding a more direct proof.
Question:
Let $(X, d)$ be a separable metric space with a countable dense subset $Z$. Prove that any subspace $Y$ of $X$ is also separable.
My Attempt:
Difficulty:
For some points $p$ in $Y$, it's not straightforward to find a sequence in $Y \cap Z$ that converges to $p$.
Solution:
We consider two cases:
Case 1: $p$ is an isolated point in $Y$
In this case, we can find an open set $U_p$ in $X$ such that $U_p \cap Y = \{ p \}$. Since $Z$ is dense in $X$, there exists a point $q \in Z$ such that $q \in U_p$. This defines an injection $i: S \to Z$, where $S$ is the set of isolated points in $Y$. Therefore, $S$ is at most countable.(afterwards i plan to combine $S$ with $Z\cap Y$, which is also at most countable)
Case 2: There exists a sequence $\beta$ in $Y$ converging to $p$
We claim that there exists another sequence $\alpha$ in $Y \cap Z$ that also converges to $p$.
If this is not the case, we can find a ball $B(p, r_1)$ such that $B(p, r_1) \cap Y \cap Z = \emptyset$. Let $z_1, \ldots, z_k$ be the points of $\alpha$ inside $Y$ and let $d_1, \ldots, d_k$ be their distances to $p$. Without loss of generality, assume $d_1$ is the smallest and $d_1 \geq r_1$. Set $d = \frac{r_1}{3}$.
Case 2.1: $\beta$ contains an interior point $y$ of $Y$ with $y \neq p$ and $y \in B(p, d)$
In this case, we can find an open set $U$ contained in $Y$ and $B(p, d)$. However, $U \cap Z = \emptyset$, which is a contradiction.
Case 2.2: All points in $\beta$ are boundary points of $Y$
(Here, I got stuck.)
but the problem is, what if $Y$ is neither open nor closed, and looks very weird?
– Tyson Che Sep 07 '23 at 07:32