[proofplan]
We prove the equality of subsets of $B$ by extensionality. For the forward inclusion, an element in the image of the union has a preimage lying in some $S_i$, so it lies in the corresponding image $f(S_i)$. For the reverse inclusion, an element lying in some image $f(S_i)$ has a preimage in $S_i$, hence in the union.
[/proofplan]
[step:Show every value attained on the union is attained on one member of the family]
Let $y \in f\left(\bigcup_{i \in I} S_i\right)$. By the definition of image of a subset under $f$, there exists an element
\begin{align*}
x \in \bigcup_{i \in I} S_i
\end{align*}
such that $f(x)=y$. By the definition of union of a family of sets, there exists an index $i_0 \in I$ such that $x \in S_{i_0}$. Therefore $y=f(x) \in f(S_{i_0})$. Since $f(S_{i_0}) \subset \bigcup_{i \in I} f(S_i)$, we obtain
\begin{align*}
y \in \bigcup_{i \in I} f(S_i).
\end{align*}
Thus
\begin{align*}
f\left(\bigcup_{i \in I} S_i\right) \subset \bigcup_{i \in I} f(S_i).
\end{align*}
[guided]
We prove the first inclusion by taking an arbitrary element of the left-hand side and unpacking the definitions. Let
\begin{align*}
y \in f\left(\bigcup_{i \in I} S_i\right).
\end{align*}
The expression $f\left(\bigcup_{i \in I} S_i\right)$ means the set of all values $f(x)$ where $x$ belongs to $\bigcup_{i \in I} S_i$. Hence there exists
\begin{align*}
x \in \bigcup_{i \in I} S_i
\end{align*}
such that $f(x)=y$.
Now we use the meaning of membership in an indexed union. The condition $x \in \bigcup_{i \in I} S_i$ means that $x$ belongs to at least one member of the family. Therefore there exists an index $i_0 \in I$ such that $x \in S_{i_0}$. Since $x \in S_{i_0}$ and $f(x)=y$, the definition of image gives
\begin{align*}
y \in f(S_{i_0}).
\end{align*}
Finally, because $f(S_{i_0})$ is one of the sets appearing in the union $\bigcup_{i \in I} f(S_i)$, membership in $f(S_{i_0})$ implies
\begin{align*}
y \in \bigcup_{i \in I} f(S_i).
\end{align*}
Since $y$ was arbitrary, this proves
\begin{align*}
f\left(\bigcup_{i \in I} S_i\right) \subset \bigcup_{i \in I} f(S_i).
\end{align*}
[/guided]
[/step]
[step:Show every value attained on one member is attained on the union]
Let $y \in \bigcup_{i \in I} f(S_i)$. By the definition of union, there exists an index $i_0 \in I$ such that $y \in f(S_{i_0})$. By the definition of image, there exists $x \in S_{i_0}$ such that $f(x)=y$. Since $S_{i_0} \subset \bigcup_{i \in I} S_i$, we have $x \in \bigcup_{i \in I} S_i$. Hence $y=f(x)$ belongs to $f\left(\bigcup_{i \in I} S_i\right)$. Therefore
\begin{align*}
\bigcup_{i \in I} f(S_i) \subset f\left(\bigcup_{i \in I} S_i\right).
\end{align*}
[/step]
[step:Conclude equality by extensionality]
We have proved both inclusions
\begin{align*}
f\left(\bigcup_{i \in I} S_i\right) \subset \bigcup_{i \in I} f(S_i)
\end{align*}
and
\begin{align*}
\bigcup_{i \in I} f(S_i) \subset f\left(\bigcup_{i \in I} S_i\right).
\end{align*}
By extensionality of sets, the two subsets of $B$ are equal:
\begin{align*}
f\left(\bigcup_{i \in I} S_i\right) = \bigcup_{i \in I} f(S_i).
\end{align*}
[/step]