I want to find out if the following statement is true or false, and prove why:
Let $X$ be a topological space. Suppose $X=A \cup B$ and $f:X \rightarrow Y$ is a map whose restrictions to $A$ and $B$ are $f_A:A \rightarrow Y$ and $f_B:B \rightarrow Y$. Then $f$ is continuous if and only if $f_A$ and $f_B$ are continuous.
I'm not really sure where to start with a proof on this. What's a good way to prove a map is continuous in this context?
Use the definition : $f$ is continuous if and only if $f^{-1}(V)$ is open for any $V$ open set (and using the fact that the topology on a subset $T$ of $X$ is defined by all the $V\cap T$ where $V$ is a open set of $X$).
It is easy to verify that $$f_{|T}^{-1}(V)=\{T\cap f_{|T}^{-1}(V)\} $$
So, if $f$ is continuous, $f_{|A}$ and $f_{|B}$ are continuous.
Without further assumption on $A$ and $B$, the converse is false (cf. the other comment for a counter example).