# Showing that a piecewise function is measurable

I'm doing an assignment for a (first) course in analysis, and I'm having some trouble with showing that functions are measurable.

In this problem $(X,\mathcal{A},\mu)$ and $(Y,\mathcal{B},\nu)$ are two measure spaces. We assume that $X$ and $Y$ are disjoint and let $Z=X\cup Y$.

$\mathcal{C}=\{A\cup B:A\in\mathcal{A}$ and$B\in\mathcal{B}\}$ is a $\sigma$ -algebra.

Assume that $f:X\rightarrow\bar{\mathbb{R}}$ and $g:Y\rightarrow\bar{\mathbb{R}}$ are two measurable functions (with respect to $\mathcal{A}$ and $\mathcal{B}$, respectively), and define $h:Z\rightarrow\bar{\mathbb{R}}$ by

EDIT: Horrible typo corrected:

$h(z)\begin{cases} \begin{array}{c} f(z)\, if\, z\in X\\ g(z)\, if\, z\in Y \end{array}\end{cases}$

Show that $h$ is a measurable function.

Here is my (contrapositive) attempt so far:

$h(z)$ is measurable with respect to $\mathcal{C}$ if the set $\{z\in Z\,:\, h(z)<r\}$ is measurable (where $Z=X\cup Y )$. I also know that $h^{-1}(C)\in\mathcal{C}$ for all open and closed sets $C$ if $h(z)$ is measurable with respect to $\mathcal{C}.$

Assume that $f(z)$ and $g(z)$ are not measurable, then there exists $S\subset\mathbb{\bar{\mathbb{R}}}$ such that $f^{-1}(S)\notin\mathcal{A}$ and $g^{-1}(S)\notin\mathcal{B}$ , but $f^{-1}(S)\,\cup\, g^{-1}(S)\in Z$ , and then the set $\{z\in Z\,:\, h(z)<r\}$ is not measurable for all $r\in\mathbb{R}$ (e.g. when $z=f^{-1}(S)\,\cup\, g^{-1}(S)$) , which means $h(z)$ cannot be measurable. Therefore $h(z)$ must be measurable.

I guess what I'm saying here, is that if you think of $h(z)$ as a set that has to be measurable, it can't have subsets that aren't measurable. I'm not sure if this makes sense. If I'm way off, please point me in the right direction.

• All you need is $h^{-1}(S)=f^{-1}(S)\cup g^{-1}(S)$. Apr 28, 2013 at 15:59
• @julien does this follow from the fact that $x\in h^{-1}(S)$ has to be either in $f^{-1}(S)$ or $g^{-1}(S)$ or both? Apr 29, 2013 at 10:01
• Not both, that would be intersection. We have $x\in h^{-1}(S)$ iff $h(x)\in S$. That is, either $x\in A$ and $f(x)\in S$, or $x\in B$ and $g(x)\in S$. That is either $x\in f^{-1}(S)$ or $x\in g^{-1}(S)$. Finally, that is $x\in f^{-1}(S)\cup g^{-1}(S)$. Apr 29, 2013 at 10:23
• @julien just wanted to inform that I made a pretty bad typo wrt the function $h(z)$. Apr 29, 2013 at 10:43
• Ok. But this does not change anything. You still have $h^{-1}(S)=f^{-1}(S)\cup g^{-1}(S)$ measurable for every measurable $S$. Apr 29, 2013 at 10:45