Let X = A ∪ B, where A and B are subspaces of X. Let f : X → Y;
suppose that the restricted functions

f|A : A → Y and f|B : B → Y

are continuous. Show that if both A and B are closed in X, then f is continuous