Coproducts in Top preserved under pullbacks? The statement which I'd like to prove is as follows. Let $A=\coprod_{i \in I} A_i$ be the coproduct of the sets $\left(A_i\right)_{i \in I}$ and suppose that we have for all $i \in I$ a pullback in Top as displayed below. We claim that $B = \coprod_{i \in I}B_i$.
$$\require{AMScd}
\begin{CD}B_i @>{g_i}>> A_i;\\
@VVV @VVV \\
B @>{g}>> A;
\end{CD}$$
Thanks in advance for your help!
 A: Assume we have pullback squares in Top
$$
\require{AMScd}
\begin{CD}
B_i @>{g_i}>> A_i\\
@VV{j_i}V @VV{i_i}V \\
B @>{g}>> A
\end{CD}
$$
This induces a commutative square
$$
\require{AMScd}
\begin{CD}
\oplus B_i @>{\oplus g_i}>> \oplus A_i \\
@VV{(j_i)_i^\sharp}V @VV{(i_i)_i^\sharp}V \\
B @>{g}>> A
\end{CD}
$$
and I claim it is a pullback square:
Let $C$ be a space with maps $k: C\to \oplus A_i$ and $l: C \to B$ such that $(i_i)_i^\sharp k = g l$. The open preimages of $A_i$ under $k$ form a separation of $C$ into $\oplus C_i$ such that $k = \oplus k_i$ and $l = (l_i)_i^\sharp$ for maps $l_i : C_i \to B$. These maps satisfy $i_i k_i = g l_i$ and thus induce maps $m_i: C_i \to B_i$ such that $g_i m_i = k_i$ and $j_i m_i = l_i$. The resulting map $m = \oplus m_i: C \to \oplus B_i$ is now a map such that $\oplus g_i m = k$ and $(j_i)_i^\sharp m = l$. Can you prove that it is the only $m: C \to \oplus B_i$ making the triangles commute?
To apply this to your specific case, note that if $(i_i)_i^\sharp: \oplus A_i \to A$ is the identity, then $(j_i)_i^\sharp: \oplus B_i \to B$ is an isomorphism.

Here is a more direct approach, inspired by Giorgio Mossa's comment: When $i_i$ is the inclusion of a set $A_i$ in $A$, then $B_i$ can be regarded as the preimage of $A_i$ under $g$ (in a pullback square in Set). When $A_i$ is a subspace of $A$, it is easy to show that $B_i$ is a subspace of $B$. Since each $A_i$ is open, $B_i$ is open in $B$, and since the $A_i$ partition $A$, so do the sets $B_i$ for $B$. This shows that $B$ is the topological sum of the $B_i$ when $A=\oplus A_i$.
A: I believe there are many ways to prove you claim, here is one.


*

*For start one can observe that $A=\coprod A_i$ if and only if $(A_i)_i$ is an open cover made of pairwise disjoint sets of $A$ (up to identifying each $A_i$ with its image in $A$ through the embedding $A_i \to A$).

*Then we can use the fact that the following is a pullback square
$$\require{AMScd}
\begin{CD}
g^{-1}(B) @>{g_i}>> A_i \\
@VVV @VVV \\
B @>>g> A
\end{CD}
$$
hence proving that $B_i=g^{-1}(A_i)$, which by the previous point implies that the $B_i$ are open sets in $B$.

*Finally we can observe that $(B_i)_i$ form a cover of disjoint subsets of $B$ which by point 1 implies that $B=\coprod B_i$.


Since this seems like an homework I would prefer not give you all the details. If you need more help feel free to ask, but I am quite confident you will be able to complete the proof yourself.
