This is a question from Irving Kaplansky's Set theory and metric spaces.
Let $A_1, A_2, A_3, \cdots$ be subsets of a metric space $M$. Suppose each $A_i$ is separable. Prove that $\cup_i A_i$ is separable.
I found a related link for finite unions.
For my question, here is my attempt.
For each $i$, since $A_i$ is separable, we can find a countable dense subset $D_i$ of $A_i$. I claim that $D = \cup_i D_i$ is a countable dense subset of $\cup_i A_i$.
First note that $D$ is a countable union of countable sets, and is therefore countable.
For density, let $\epsilon > 0.$ Let $y \in \cup_i A_i$. Then $y \in A_i$ for some $i$. By density of $D_i$ in $A_i$, there is $x \in D_i$ such that $d(x,y) < \epsilon$. Since $x \in \cup_i D_i$, we see that $D$ is dense in $\cup_i A_i$.
Is this correct? Would it work if the collection of subsets is uncountable? Thank you!