I have a small question, of whose solution I am not sure. I appreciate any more rigorous answer, since I have the feeling the solution should not be that easy. The problem is to prove the following statement.
Given a topological space $X=A\cup B$, where $A$ and $B$ are closed, and a function $f : X \to Y$, if the restrictions $f\vert_{A}: A \to Y$ and $f\vert_{B}: B \to Y$ to $A$ and $B$, respectively, are continuous, so is $f$.
In particular, this has the nice implication, that for reducible spaces we only need to check continuity on the constituent closed sets.
In order to prove that $f$ is continuous it is enough to prove that $f^{-1}(F)$ is a closed subset of $X$ whenever $F$ is a closed subset of $Y$.
If $i:A\to X$ denotes the inclusion then $f\circ i:A\to Y$ is continuous so that: $$A\cap f^{-1}(F)=i^{-1}(f^{-1}(F))=(f\circ i)^{-1}(F)$$ is closed in $A$ where $A$ is equipped with the subspace topology inherited from $X$.
That means that $A\cap f^{-1}(F)=A\cap H$ where $H$ is a closed subset of $X$.
But also $A$ is a closed subset of $X$ so we are allowed to conclude that $A\cap f^{-1}(F)=A\cap H$ is a closed subset of $X$.
Likewise it can be proved that $B\cap f^{-1}(F)$ is a closed subset of $X$ and then we can conclude that: $$f^{-1}(F)=\left(A\cap f^{-1}(F)\right)\cup\left(B\cap f^{-1}(F)\right)$$ is a closed subset of $X$.