Pasting Lemma/Pair of Continuous Mappings on Open Sets/Proof 2

Proof
From Union of Mappings which Agree is Mapping
 * $f \cup g$ is well-defined.

By :
 * $f \cup g$ is continuous $\paren {f \cup g}^{-1} \sqbrk U$ is open in $A \cup B$ for every open $U$ in $Y$.

Let $U$ be an arbitrary open subset in $Y$.

From Preimage of Union Mapping is Union of Preimages:
 * $\paren {f \cup g}^{-1} \sqbrk U = f^{-1} \sqbrk U \cup g^{-1} \sqbrk U$

By :
 * $f^{-1} \sqbrk U$ is open in $A$
 * $g^{-1} \sqbrk U$ is open in $B$.

From Open Set in Open Subspace:
 * $f^{-1} \sqbrk U$ and $g^{-1} \sqbrk U$ are open in $X$.

By :
 * $A \cup B$ is open in $X$
 * $f^{-1} \sqbrk U \cup g^{-1} \sqbrk U$ is open in $X$

From Open Set in Open Subspace:
 * $f^{-1} \sqbrk U \cup g^{-1} \sqbrk U$ is open in $A \cup B$

Hence:
 * $\paren {f \cup g}^{-1} \sqbrk U$ is open in $A \cup B$

Since $U$ was an arbitrary open subset of $Y$:
 * for all open subsets $U$ of $Y$, $\paren {f \cup g}^{-1} \sqbrk U$ is open in $A \cup B$

By :
 * $f \cup g$ is continuous.