Let $(X_j)_{j\in J}$ be an indexed family of non-empty topological spaces.
If $X_j$ second countable for each j and $\coprod_{j\in J}X_j$ is second countable.
Show that $J$ is countable.
Note: $\coprod_{j\in J}X_j$ $=$ $\bigcup_{j\in J}X_j^*$ where $X_j^*$ is the image of $X_j$ under the canonical injection from $X_j$ to the disjoint union.
My attempt:
Observe that there exists a mapping $g: J \rightarrow \bigcup_{j\in J}X_j^*$ such that $g(j)\in X_j^*$ for each J. This mapping is injective since for $I\neq J$,$X_I^*\neq X_J^*$. Let $\mathbb{B}$ be a countable basis for the disjoint union. Define a map $f: \bigcup_{j\in J} X_j^* \rightarrow \mathbb{B}$ by assigning $x$ the basis $B_m \in \mathbb{B}$ which owns $x$ where $m$ is the least such natural number. This map is injective because for $\alpha \neq \beta$, $X_{\alpha}^* \cap X_{\beta}^*$ is empty. Thus $f \circ g$ is injective and since $\mathbb{B}$ is countable, it follows that so is $J$.
Is this proof correct? (please answer this)