Continuous Mapping on Finite Union of Closed Sets

Theorem
Let $T = \left({X, \tau}\right)$ be a topological space.

For all $i \in \left\{{1, 2, \ldots, n}\right\}$, let $C_i$ be closed in $T$.

Let $f: X \to Y$ be a mapping which is continuous on $C_i$ for all $i$.

Then $f$ is continuous on $\displaystyle \bigcup_{i=1}^n C_i$.

If $\left\{{C_i}\right\}$ is infinite, the result does not necessarily hold.