$X$ is a topological space which is a reunion of two closed subspaces $\mathbb {X}_1$ and $\mathbb {X}_2$. Suppose $f$ is a function of $X$ in topological space $Y$. Show that these two following conditions are equivalent;
i) the restrictions of $f$ in $\mathbb {X}_1$ and $\mathbb {X}_2$ are continuous;
ii) $f$ is continuous.