Gluing Disjoint Topological Spaces
 Definition: Let $X$ and $Y$ both be disjoint topological spaces. Let $A \subseteq X$ be nonempty and let $f : A \to Y$ be a map where $f(A) = B$ is the range of $f$. Define an equivalence relation $\sim$ on $X \cup Y$ by saying that $a \sim b$ if $f(a) = b$, as well as, $x \sim x$ for all $x \in X \cup Y$, i.e., with the equivalence relation $\sim$ we associate points that are associated by $f$ as well as standardly associated points with themselves. The equivalence classes of $\sim$ are thus $\{ \{ y \} \cup f^{-1}(\{ y \}) : y \in B \}$ and the singleton sets $\{ y \}$ where $y \in B$. The result is called the Gluing of $X$ and $Y$ along $f$ written $(X \oplus Y) / \sim$ or $X \cup_f Y$.
In simpler terms, consider two disjoint topological spaces $X$ and $Y$ and consider a subset of $A$ of $X$. Let $f : A \to Y$ be any function where $f(A) = B$ is the range of $f$ over $A$. We then glue together points in $A$ with their image under $f$, as well as we "glue" points that are themselves to themselves.
For a very simple example, consider the following disjoint spaces $[0, 1]$ and $[2, 3]$ with the subspace topologies from $\mathbb{R}$. Let $A = \{ 0, 1 \}$ and define the function $f(x)$ for $x \in A$ simply by $f(0) = 2$ and $f(1) = 2$. Then we glue the points $0, 1 \in [0, 1]$ to $2 \in [2, 3]$ to get $(X \oplus Y) / \sim = X \cup_f Y$: