Exercise:
Let X and Y be topological spaces and $f: X → Y$ be a map.
Assume that $X =X_1\bigcup X_2$, where $X_1$ and $X_2$ are two subsets of X.
Assume that $X_1$ and $X_2$ are closed/open subsets.
Show that $f$ is continuous $ \iff f|x_1$ and $f|x_2 $ are continuous
Definition: A map $f: X → Y$ between two topological spaces is continuous if $f^{-1}$ is open/closed in X for every open/closed set in Y.
Solution:
$ \Rightarrow$:
Assume that $f$ is continuous. Then from the definition we have that for every open V in Y is $f^{-1}(V)$ open i X.
But $f^{-1}(V) =(f^{-1}(V) \bigcap X_1) \bigcup(f^{-1}(V) \bigcap X_2) $, so $f|x_1$ and $f|x_2 $ are continuous because $f$ is continuous?
$\Leftarrow$:
Want to show that for every V open in Y then $f^{-1}(V)$ is open in X, which is equivalent to the continuity of $ f $.
Assume that $f|x_1$ and $f|x_2 $ are continuous. Let $V \subset Y$ be open.
Then $f^{-1}(V) =(f^{-1}(V) \bigcap X_1) \bigcup(f^{-1}(V) \bigcap X_2) $ is open, since $f|x_1$ and $f|x_2 $ are continuous. Hence $f$ is continuous.
I tried to prove the statement when $X_1$ and $X_2$ are both open, since a similar argument applies when X and Y are both closed. But I'm not completely sure that my method is right. Any help would be greatly appreciated.
Your proof is flawless.
You are using the fact that $$f^{-1}(V) =(f^{-1}(V) \bigcap X_1) \bigcup(f^{-1}(U) \bigcap X_2)$$
This is OK if you have already proved it, which I assume you did.
Also, in your last statement, you need to change $X$, $Y$ to $X_1 $, $X_2$ are both closed.