Let $A,B$ be topological spaces and $\phi:A\rightarrow B$ a map.
Let $A',A''\subseteq A$ with $A=A'\cup A''$ and the maps $\phi|_{A'}:A'\rightarrow B$ en $\phi|_{A''}:A''\rightarrow B$ are continuous.
How do I prove that $\phi$ is continuous if
1. $A',A''$ are open?
2. $A',A''$ are closed?
What I have done:
I know that for $\phi$ to be continuous we must have that $\phi^{-1}B\in\mathcal{T_A}$, but I'm not sure what to do with the information that is given.
Hint: Let $U$ be an open set in $B$.
In the case where $A'$ and $A''$ are open (each of the following statements requires proof):
1) $$\phi^{-1}U=\phi|_{A'}^{-1}(U)\cup\phi|_{A''}^{-1}(U) $$
2) Since $\phi|_{A'}$ and $\phi|_{A''}$ are continuous (and assuming they are given the subspace topology), there are open sets $V'$ and $V''$ in $A$ so that $$ \phi|_{A'}^{-1}(U)=V'\cap A' $$ and $$ \phi|_{A''}^{-1}(U)=V''\cap A'' $$
3) Then, $\phi^{-1}U=(V'\cap A')\cup (V''\cap A'')$, which is a finite union/intersection of open sets (and therefore is open).
For the case where $A'$ and $A''$ are closed, use the fact that the preimage of a closed set is closed is another definition of continuity.