# Let $f$ be a function with measurable domain $D$. show that$f$ is mble iff the function $g$ is measurable

I am working through some problems in Real Analysis (Royden) and I came across this one.

Let $f$ be a function with measurable domain $D$. Show that $f$ is measurable if and only if the function $g:\mathbb{R}\to \mathbb{R}$, defined by $g(x)=f(x)$ for $x \in D$ and $g(x)=0,$ for $x\notin D$, is measurable.

I realized that in one direction, if $g$ is measurable then $$\{x \in D : f(x)>c\}=\{x \in \mathbb{R}:g(x)>c \}\cap D$$ since $g(x)=f(x)$ for $x \in D$. Because the sets $D$ and $\{x \in \mathbb{R}:g(x)>c \}$ are measurable , $f$ is measurable.

On the other hand if $f$ is measurable, then $$\{x\in\mathbb{R}:g(x)>c\}= \begin{cases} \{x\in D:f(x)>c\}, &\mbox{ if }x\in D\\ D^c, &\mbox{ if }x\notin D \mbox{ and } c<0\\ \varnothing, &\mbox{ if }x\notin D \mbox{ and } c\geq0. \end{cases}$$ Because $\{x\in D:f(x)>c\}$, $D^c$, and $\varnothing$ are meas sets, it follows that $g$ is measurable.

This illustration is almost clear to me except the part where we consider the cases where $c \ge$ 0 and $c<0$. I don't understand why we do that. Can someone explain to me or give me a similar one.

• @Summarizing the comments, I edited your question. Dec 22 '16 at 7:48

$\Rightarrow$ If $f$ is meas and $\alpha\in\mathbb{R}$ then

$$\{x\in\mathbb{R}:g(x)<\alpha\}= \begin{cases} \{x\in D:f(x)<\alpha\}, &\mbox{ if }x\in D\\ D^c, &\mbox{ if }x\notin D \mbox{ and } \alpha >0\\ \varnothing, &\mbox{ if }x\notin D \mbox{ and } \alpha \leq0. \end{cases}$$ This shows that $g$ is meas.

$\Leftarrow$ Suppose $g$ is meas and let $\alpha\in\mathbb{R}$. Then $$f^{-1}((-\infty,\alpha))=g^{-1}((-\infty,\alpha))\cap D.$$ This shows that $f$ is meas.

• Could it also go this way. $$\Rightarrow$$ if $f$ is mble and $\alpha \in R$ then $$g^{-1}((\alpha ,\infty))= \left\{ \begin{array}{ll} f^{-1}((\alpha ,\infty)) & \text{if} \quad x\in D \\ D^c & \text{if} \quad x \notin D \quad \text{and} \quad \alpha < 0 \\ \phi & \text{if} \quad x\notin D \quad \text{and} \quad\alpha \ge 0 \end{array} \right.$$ And that G is measurable? Dec 22 '16 at 7:21
• Yes, and thank you. Dec 22 '16 at 7:31
• Your first equation doesn't make sense. The right side refers to a variable $x$ that is not present on the left. Dec 22 '16 at 7:51
• @mario, what are the differences between the first and the edited one, can you explain further? if possible in grammar as well. thanks Dec 22 '16 at 8:16
• @J.Kyei The edit is the same as the original, and still has the same issue, although it is now harder to see - the $x$ in the if statement cases is not bound, where as the two set comprehensions have an (unrelated) bound variable $x$. I believe the correct equation is: $$g^{-1}((-\infty,\alpha))=\begin{cases}f^{-1}((-\infty,\alpha))\cup D^c,&\mbox{if }\alpha>0\\f^{-1}((-\infty,\alpha)),&\mbox{if }\alpha\le 0\end{cases}.$$ Dec 22 '16 at 11:56

The second part (the part you have are questioning) follows directly from Proposition 5(ii) in your text Real Analysis (Royden).