Problem: Let $X$ and $Y$ be two topological spaces and $f:X\to Y$ be any function. Let $C_1$ and $C_2$ be two closed sets in $X$ such that $C_1\cup C_2 = X$. Show that $f\big|_{C_1}$ and $f\big|_{C_2}$ are continuous if and only if $f$ is continuous.
Solution: Let us show the restriction maps by $g_1 = f\big|_{C_1}$ and $g_2 = f\big|_{C_2}$. Let $g_1, g_2$ be continuous. We need to show that $f$ is continuous. For that, we will show that the inverse image of any closed set is closed. Let $C$ be any closed set in $Y$. Observe that,
\begin{align*}
f^{-1}(C) & = f^{-1} \left( C \right) \cap X \\
& = f^{-1} (C) \cap \left( C_1 \cup C_2 \right) \\
& = \left( f^{-1} (C) \cap C_1 \right) \cup \left( f^{-1} (C) \cap C_2 \right) \\
& = g_1^{-1} (C) \cup g_2^{-1} (C)
\end{align*}
Since $g_1, g_2$ are continuous, the above set will be closed. Hence, $f$ is continuous.
On the other hand, if $f$ is continuous, then the restriction of it will be continuous. For any closed set $C \subseteq Y$, we have
\[
g_1 ^{-1} (C) = g^{-1} (C) \cap X = f^{-1} (C) \cap X.
\]
As $f$ is continuous, the above set will be closed and hence $g_1$ is continuous.