I wish to know when a union of a family $\{f_i \}_{i \in I}$ of functions $f_i: X_i \to Y_i$ is itself a function $\bigcup_{i \in I} X_i \to \bigcup_{i \in I} Y_i$.
I take the definition of a function $X \to Y$ as of a relation $f \subseteq X \times Y$ so that $\mathrm{dom \ f} = \{ x \in X \ | \ \exists y \in Y: \ (x,y) \in f \} = X$ and $(x,y_1), \ (x,y_2) \in f \Rightarrow y_1 = y_2$.
Now, let $\{ f_i \}_{i \in I}$ be a family of functions, $f_i \in {Y_i}^{X_i}$.
I know that $\bigcup_{i \in I} f_i \subseteq \bigcup_{i \in I} X_i \times Y_i \subseteq \bigcup_{i \in I} X_i \times \bigcup_{i \in I} Y_i$.
What is more, $x \in \bigcup_{i \in I} X_i \Leftrightarrow \exists i \in I: \ x \in X_i \Rightarrow \exists y \in Y_i: \ (x,y) \in f_i \Rightarrow \exists y \in \bigcup_{i \in I} Y_i: (x,y) \in \bigcup_{i \in I} f_i \Leftrightarrow x \in \mathrm{dom \ \bigcup_{i \in I} f_i}$.
What is left to check is when $(x,y_1), (x,y_2) \in \bigcup_{i \in I} f_i \Rightarrow y_1 = y_2$.
But $(x,y_1), (x,y_2) \in \bigcup_{i \in I} f_i$ means that there exists $i, j \in I$ so that $f_i(x) = y_1$ and $f_j(x) = y_2$. Is it right?