I've been working through the Munkres Topology text on my own, and I am not sure if the following argument is correct. Fishing around the internet a bit for some alternative answers and it looks like the approaches others have taken to this problem are not the same way that I approached it, so I'm concerned that I'm making some conceptual errors. The problem:
Let {A$_{\alpha}$} be a collection of subsets of X. Let X=$\cup_{\alpha}$A$_{\alpha}$. Let f: X$\rightarrow$Y; suppose that f$\mid$A$_{\alpha}$ is continuous for each $\alpha$. An indexed family of sets {A$_{\alpha}$} is said to be locally finite if each point of X has a neighborhood that intersects A$_{\alpha}$ for only finitely many values of $\alpha$. Show that if the family {A$_{\alpha}$} is locally finite and each A$_{\alpha}$ is closed, then f is continuous.
Attempt at solution:
Let x $\in$ X. Since there exists a neighborhood U$_{x}$ of x that intersects A$_{\alpha}$ for only finitely many $\alpha$, U$_{x}$ can be contained in a finite collection of A$_{\alpha}$'s. So x $\in$ U$_{x}$ $\subset$ $\cup_{i=1}^{n}$A$_{i}$ $\subset$ X. Then, since each A$_{i}$ is closed and f$\mid$A$_{i}$ continuous for each i, by repeated application of the Pasting Lemma, f$\mid$$\cup_{i=1}^{n}$A$_{i}$ is continuous. Then, since U$_{x}$ $\subset$ $\cup_{i=1}^{n}$A$_{i}$, by restricting the domain (Theorem 18.2d), f$\mid$U$_{x}$ continuous. Since it is given that such a neighborhood U$_{x}$ exists for each x $\in$ X, then X can be written as the union of open sets U$_{x}$, where f$\mid$U$_{x}$ is continuous for each x, and so by Theorem 18.2f (local formulation of continuity), f: X$\rightarrow$Y is continuous.
Feel like I'm missing something, or making some incorrect assumptions. Any help would be appreciated.