Proposition 5 (b), Sec. 3.1, in Royden's REAL ANALYSIS: If $f$ is measurable, how to show that these restrictions of $f$ also are measurable? Here is Proposition 5, Sec. 3.1, in the book Real Analysis by H. L. Royden & P. M. Fitzpatrick, 4th edition:

Let $f$ be an extended real-valued function on $E$.


(i) If $f$ is measurable on $E$ and $f = g$ a.e. on $E$, then $g$ is measurable on $E$.


(ii) For a measurable subset $D$ of $E$, $f$ is measurable on $E$ if and only if the restrictions of $f$ to $D$ and $E \setminus D$ are measurable.

In the proof of (ii), we see that, for any real number $c$, we have the identity
$$
\{ x \in E\,  | \,  f(x) > c \} = \{ x \in D \, | \, f(x) > c \} \cup \{ x \in E \setminus D \, | \,  f(x) > c \}.
$$
From this identity we can conclude that if the restrictions of $f$ to $D$ and $E \setminus D$ both are measurable, then $f$ is also measurable on $E$.
How to deduce from this identity that if $f$ is measurable on $E$, then the restrictions of $f$ to $D$ and $E \setminus D$ both are measurable?
We of course have
$$
\{ x \in D \, | \, f(x) > c \} \cap \{ x \in E \setminus D \, | \, f(x) > c \} = \emptyset.
$$
Last but not least, although it has not been stated explicitly, the set $E$ itself is measurable (i.e. a measurable subset of $\mathbb{R}$), as is apparent from the context.
 A: Let $(X, \mathcal{M}) $ be a measurable space, $(Y, \tau)$ a topological one, and $f : X \to Y$ a measurable function. $$\forall E \in \mathcal{M}, \forall U \in \tau \quad f\vert_E^{-1}(U) = f^{-1}(U) \cap E$$
Since $\sigma$-algebras are closed by intersection and $f$ is a measurable function, $f^{-1}(U) \cap E \in \mathcal{M}$ hence $f\vert_E$ is a measurable function when considering the $\sigma$-algebra of $\mathcal{M}$ sets intersected with $E$
A: Suppose $f:E\rightarrow\mathbb{R}$ where $(E,\mathscr{E})$ is measurable space and $\mathbb{R}$ is equipped with the Borel $\sigma$-algebra. Let $D\in\mathscr{E}$. Then also $E\setminus D\in\mathscr{E}$.
Since your question only pertains to (ii) in your posting,

*

*suppose first that the restrictions of $f$  to $D$ and to $E\setminus D$ are measurable. Then, for any $c\in\mathbb{R}$
$$\{x\in E:f(x)>c\}=\{x\in D:f(x)>c\}\cup\{x\in E\setminus D: f(x)>c\}$$
From this, it follows that $f^{-1}(c,\infty)\in\mathscr{E}$ since both $\{x\in D:f(x)>c\}$ and $\{x\in E\setminus D: f(x)>c\}$ are in $\mathscr{E}$.


*Now suppose the $f$ is measurable. Then for any $c\in\mathbb{R}$,
$$\begin{align}
 \{x\in D: f(x)>c\}&=D\cap\{x\in E: f(x)>c\}\in\mathscr{E}\\
\{x\in E\setminus D: f(x)>c\}&=(E\setminus D)\cap\{x\in E: f(x)>c\}\in\mathscr{E}
\end{align}
$$
From this, it follows that the restrictions of $f$ to $D$ and to $E\setminus D$ are measurable.
