Take topological spaces $X$ and $Y$, a function $f:X \to Y$ and a family $(A_i)_{i\in I}$ os subsets of $X$ and $X= \cup A_i$. Assume that $f|_{A_i} $is continuous for each $i \in I$. Show that if I is finite and each $A_i$ is closed in $X$, then $f$ is continous.
$f$ is continous if preimage of every closed set in $Y$ is closed in $X$. I know that a union of finitely many closed sets is closed but I am not sure how to mix it.
For each $i \in I$ $f_i : A_i \to Y$ is continous, that means for each closed $C \subset Y$, $f^{-1}(C)$ is closed in $A_i$. Can I write something like this $f^{-1}(C_i)=A_i $?
You ought to be precice. First off, you need to say explicitly that $f_i$ means $f|_{A_i}$. Also, what $f_i$ being continuous really means is that $f_i^{-1}(C)$ is closed in $A_i$, not that $f^{-1}(C)$ is closed in $A_i$. What would that even mean if $f^{-1}(C)\not\subseteq A_i$?
From here, note that we have $f_i^{-1}(C) = A_i\cap f^{-1}(C)$. Can you express $F^{-1}(C)$ in terms of $A_i\cap f^{-1}(C)$? Finally, can you use this to show that $f^{-1}(C)$ is closed in $X$?