Lemma 4.6.2 (Gluing Lemma for Continuous Functions). Let $X, Y$ be topological spaces, $\seq{U_i}\subset 2^{X}$ be open sets, and $\seqi{f}$ with $f_{i} \in C(U; Y)$ for all $i \in I$. If:

  1. $\bigcup_{i \in I}U_{i} = X$.

  2. For each $i, j \in I$, either $U_{i} \cap U_{j} = \emptyset$, or $f_{i}|_{U_i \cap U_j}= f_{j}|_{U_i \cap U_j}$.

then there exists a unique $f \in C(X; Y)$ such that $f|_{U_i}= f_{i}$ for all $i \in I$.

Proof. By Lemma 2.0.11, there exists a unique $f: X \to Y$ with $f|_{U_i}= f_{i}$ for all $i \in I$.

Let $x \in X$. By assumption (a), there exists $i \in I$ such that $x \in U_{i}$. Since $f_{i} \in C(U_{i}; Y)$, for any $V \in \cn_{Y}(f(x))$, there exists $U \in \cn_{U_i}(x)$ such that $f_{i}(U) \subset V$. As $U_{i}$ is open in $X$, $U \in \cn_{X}(x)$. Thus $f(U) = f_{i}(U) \subset V$, and $f$ is continuous at $x$.$\square$