I have that $X$ is a measure space, i.e. there is a sigma algebra $\mathcal M \subset P(X)$ and a measure $\mu$.
I am trying to prove the following but I am having a hard time.
Assume that $X=A\cup B$ where $A,B\in \mathcal M$. Let $f: X \rightarrow \mathbb R$. Prove that $X$ is measurable if and only if the restrictions of $f$ to $A$ and $B$ are measurable.
I know that I want to show:
1) Given $X$ is measurable we have the restrictions of $f$ to $A$ and $B$ are measurable.
2) Given the restrictions of $f$ to $A$ and $B$ are measurable we have that $X$ is measurable.
My attempt:
1) Given $X$ is measurable, I know that all subsets of $X$ are measurable. So we know that $A$ and $B$ are measurable. To show that $f|_A, f|_B$ are measurable I need to show that the preimage of every measurable set is measurable. So, I need to say something about $f^{-1}|_A$ and $f^{-1}|_B$ being measurable but I can't figure out how to do that.
2) Given $f^{-1}|_A$ and $f^{-1}|_B$ are measurable I want to show that $X$ is measurable. I am a bit confused about this one because isn't this just immediate since $X$ is a measure space? Or can I show this without knowing that fact somehow?
Thank you very much for your time. I am very new to real analysis and I appreciate the help.
For the first part:
You know that $f:X\rightarrow \mathbb{R}$ is measurable this means that for every open $U\subseteq\mathbb{R}$, $f^{-1}(U)$ is measurable. You want to show that $f|_A^{-1}(U) = f^{-1}(U)\cap A$ is measurable, what can you say about an intersection of measurable sets?
For the second part:
Just like before, $f|_A$ is measureable if $f^{-1}(U)\cap A$ is measurable for every open set $U$, and $f|_B$ is measurable if $f^{-1}(U)\cap B$ is measurable. Note that $f^{-1}(U) = (f^{-1}(U)\cap A) \cup (f^{-1}(U)\cap B)$ what can you say about an union of measurable sets?