HI I was checking and old question here and I have troubles to proof the following:
Proposition: Let $X$ be a space with subspaces $Y,A,B$ such that $X \backslash Y= A \sqcup B$ (disjoint union). Let $g: X \to Z$ be a function such that $g$ is continous when restricted to each of $Y \cup A, Y \cup B$. Then $g$ is continuous.
Let $f_1= g \mid Y \cup A $ and similarly $f_2= g\mid Y\cup B$. Let $U$ open in $Z$ then
$$g^{-1}(U)= (g^{-1}(U)\cap(Y \cup A))\cup (g^{-1}(U)\cap (Y \cup B))\\ =f_1^{-1}(U)\cup f_2^{-1}(U)$$
and $f_1^{-1}(U)$ is open in $Y\cup A$ but how do we know that is also open in $X$? There is another approach?
Thanks
The proposition is not true as stated.
For a counterexample we can take $X=\mathbb R$, $Y=\varnothing$, $A=\mathbb Q$ and $B=\mathbb R\setminus\mathbb Q$, and $$ g(x) = \begin{cases} 1 & x\in A \\ 0 & x \in B \end{cases} $$ Then $g$ is continuous (indeed constant) on each of $Y\cup A$ and $Y\cup B$, but everywhere discontinuous on $X$.
The claim does become true if we assume, for example, that $A$ and $B$ are open in $X$.