Locally finite closed family makes a function continious Let $X$ be a topological space and $\{A_\alpha\}_{\alpha \in A}$ be a closed, locally finite family such that $X = \cup_{\alpha \in A} A_\alpha$, $f:X \rightarrow Y$ such that $f|_{A_\alpha}$ is continous for every $\alpha \in A$. Show that $f$ is continous.
I've tried to use the (stick?) lemma (I don't know how it's called in english what in spanish is "El lema del pegado"). I tried taking a closed subset $H \subset Y$ and to prove that $f^{-1}(H) \subset X$ is closed. 
But after $f^{-1}(H) = \cup_{\alpha \in A} (f|_{A_\alpha})^{-1}(H) =: F$ I couldn't do much more. I said that is this is not closed, then $X \setminus F$ is not open, then there exists $x \in X \setminus F$ such that for every open set $U \in X$ such that $x \in U$, $U \cap F \neq \varnothing$. I'm not sure if this leads to something or if I should go in other direction
Thanks
 A: For brevity let $F=\{A_{\alpha}\}_{\alpha \in A}.$
Any $f:X\to Y$ is continuous iff $f$ is locally continuous, that is, iff for every $x\in X$ there is an open $U\subset X$ with $x\in U,$ such that $f|_U$ is continuous.
Take any $x\in X$ and let $U$ be open in $X$ with $x\in U$ and such that the set $B=\{b\in F: b\cap U\ne \emptyset\}$ is finite, which is possible because $F$ is locally finite. Since $\cup F=X,$ we have $$U=\cup \{b\cap U: b\in F\}=\cup \{b\cap U:b\in B\}.$$ 
Let $C$ be any closed subset of $Y.$ From the line above, we have $$(f|_U)^{-1}C= \cup \{U\cap ((f|_b)^{-1}C):b\in B\}.$$ Now each $f|_b$ is continuous so $(f|_b)^{-1}C$ is closed in $b,$
while $b$ is closed in $X,$
so $(f|_b)^{-1}C$ is closed in $X,$
so $U\cap ((f|_b)^{-1}C)$ is closed in $U,$
and $B$ is finite so $(f|_U)^{-1}C=\cup \{U\cap ((f|b)^{-1}C): b\in B\}$ is closed in $U.$ 
So $f|_U$ is continuous.
So $f$ is locally continuous, hence $f$ is continuous.
A: Suppose $C$ is closed in $Y$. Then, $\left(f|_{A_i}\right)^{-1}(C)$ is closed in $A_i$ for each $i$. And since $A_i$ is closed in $X$, it follows that $\left(f|_{A_i}\right)^{-1}(C)\cap A_i$ is closed in $X.$ If we can show that $\bigcup_i\left(f|_{A_i}\right)^{-1}(C)\cap A_i$ is closed in $X$, we are done, because $f^{-1}(C)=\bigcup_i\left(f|_{A_i}\right)^{-1}(C)\cap A_i$.
But this follows at once because  $\{\left(f|_{A_i}\right)^{-1}(C)\cap A_i\}_{i\in I}$ is a locally finite collection of closed sets to which we may apply the following theorem: the union of a locally finite collection of closed subsets of a topological space is itself closed. Here is the proof:
Let $\mathscr A$ be a locally finite collection of closed subsets of $X$, and consider $S:=\bigcup \mathscr A$. Let $x\in X\setminus S$. By local finiteness there is an open neighbourhood $U$ of $x$ that meets only finitely many members of $\mathscr A$, say $A_1,\cdots ,A_n$. So $U\setminus S=U\setminus \bigcup^n_{i=1}A_i$ is open and contains $x$. That is, for each $x$ in the complement of $S$, there is an open set containing $x$ that does not meet $S$. Therefore, $X\setminus S$ is open, and so $S$ is closed, as desired.
