Suppose $(X_j)_{j\in J}$ is an indexed family of topological space and $Y$ is a topological space.
$f: \coprod _{j\in J}X_j$ $\rightarrow Y$ is continuous $\iff$ The restriction of $f$ to each $X_j$ is continuous.
My Attempt:
Suppose $f$ is continuous. Let j$\in J$ and $U$ be open in $Y$. Then $f|_{X_j}^{-1}(U)=f^{-1}(U)\cap X_j$ is open in $Y$, since $f^{-1}(U)$ is open in the disjoint union space.
For the converse, let $V$ be open in $Y$. Since the restriction of $f$ to each $X_j$ is continuous, it follows that for each $j\in J$, $f|_{X_j}^{-1}(V)=f^{-1}(V)\cap X_j$ is open in $X_j$ which happens if and only $f^{-1}(V)$ is open in the disjoint union.
Is the proof correct? (Please answer this question)