Real Analysis, Folland Problem 2.1.2 Measurable Functions 
Exercise 2 - Suppose $f,g:X\rightarrow \overline{\mathbb{R}}$ are measurable.
a.) $fg$ is measurable (where $0\times(\pm\infty) = 0$).
b.) Fix $\alpha\in\overline{\mathbb{R}}$ and define $h(x) = a$ if $f(x) = -g(x) = \pm\infty$ and $h(x) = f(x) + g(x)$ otherwise. Then $h$ is measurable.

Attempted proof a.) - We have $f,g:X\rightarrow \overline{\mathbb{R}} = \mathbb{R}\cup \{-\infty,\infty\}$ measurable. Then clearly $\{-\infty\},\{\infty\}\in B_{\overline{\mathbb{R}}}$ so then $f^{-1}(\{-\infty\}),g^{-1}(\{-\infty\})\in M$ and $f^{-1}(\{\infty\}),g^{-1}(\{\infty\})\in M$. Since $\overline{\mathbb{R}}\in B_{\overline{\mathbb{R}}}$ then $$f^{-1}(\overline{\mathbb{R}}) = f^{-1}(\mathbb{R}\cup \{-\infty,\infty\}) = f^{-1}(\mathbb{R})\cup f^{-1}(\{-\infty,\infty\})\in M$$ and same for $g^{-1}(\overline{\mathbb{R}})$. Therefore, $(f+g)^{-1}(\overline{\mathbb{R}})\in M$ and $(f-g)^{-1}(\overline{\mathbb{R}})\in M$. We can write $$fg = \frac{1}{4}\left[(f+g)^2 - (f-g)^2\right]$$ and since $f + g$ and $f - g$ are measurable, we have $fg$ is measurable.
Not sure if this is right. I am still working on part b and I will post an attempted proof once I finish. Any suggestions is greatly appreciated.
 A: Let $h(x)=f(x)g(x)$. We want to show that $a\in \mathbb R\Rightarrow \left \{ x:h(x)>a \right \}\in \mathscr M$.
Note that $F:\mathbb R^{2}\to \mathbb R$ defined by $F(x,y)=xy$ is continuous, so $U=\left \{ (x,y):F(x,y)>a \right \}$ is an open set $\Rightarrow U=\bigcup_nI_n\times J_n$ where $I_n=(a_n,b_n)$and $J_n=(c_n,d_n)$ are non-degenerate intervals.
Thus,  $\left \{ x:h(x)>a \right \}=\left \{ x:(f(x),g(x))\in U \right \}=\bigcup_n\left \{ x:(f(x),g(x))\in I_n\times J_n \right \}.$
This last set is measureable since, 
$\left \{ x:(f(x),g(x))\in I_n\times J_n \right \}=\left \{ x:a_n<f(x)<b_n \right \}\cap \left \{ x:c_n<g(x)<d_n \right \} $, 
so $\left \{ x:h(x)>a\right \}$is a countable union of an intersection of measureable sets.
The advantage of this approach is that it is easily adapted to $any$ continuous $F:\mathbb R^{2}\to \mathbb R$. For instance, taking $F(x,y)=x+y$ shows $f+g$ is measureable as soon as $f$ and $g$ are.
A: Let $(X,M)$ be the measurable space.
We already know that the proof of Proposition 2.6 promptly adapts to show that if $f,g:X\rightarrow \mathbb{R}$ are measurable then $f+g$ and $fg$ are measurable.
So. the key point in Exercise 2 is to take care of the infinity values and extend Proposition 2.6 to the case where $f,g:X\rightarrow \overline{\mathbb{R}}$.
Notation: We write $[f=a]$ to mean $\{x\in X : f(x)=a\}$. In a similar way, we write  $[f<a]$ to mean $\{x\in X : f(x)<a\}$ and we write $[f>a]$ to mean $\{x\in X : f(x)>a\}$. We also write, for instance, $[f=a; g<b]$ to mean  $[f=a] \cap [g<b]$.

Exercise 2 - Suppose $f,g:X\rightarrow \overline{\mathbb{R}}$ are measurable.


a.) $fg$ is measurable (where $0\times(\pm\infty) = 0$).


b.) Fix $\alpha\in\overline{\mathbb{R}}$ and define $h(x) = a$ if $f(x) = -g(x) = \pm\infty$ and $h(x) = f(x) + g(x)$ otherwise. Then $h$ is measurable.

Proof:
Suppose $f,g:X\rightarrow \overline{\mathbb{R}}$ are measurable.
Let $f_{fin}: X \to \mathbb{R}$ be defined by: $f_{fin}(x) =f(x)$ if $f(x) \neq \pm \infty$ and $f_{fin}(x) =0$ if $f(x)=\pm \infty$.  In exactly the same way we define $g_{fin}: X \to \mathbb{R}$.
Let $E$ be any Borel set of $\mathbb{R}$, we have,
$$f_{fin}^{-1}(E)=f_{fin}^{-1}(E\setminus\{0\})\cup f_{fin}^{-1}(E\cap\{0\})$$
And we have
$$ f_{fin}^{-1}(E \setminus \{0\})=f^{-1}(E \setminus \{0\})$$
and
$$ f_{fin}^{-1}(E\cap \{0\})=\emptyset \textrm{ or } f^{-1}(\{-\infty,0,+\infty\})$$
So in any case $f_{fin}^{-1}(E \setminus \{0\})$ and $f_{fin}^{-1}(E\cap \{0\})$ are in $M$, so $f_{fin}^{-1}(E) \in M$, so $f_{fin}$ is measurable.
By a similar argument, we have that $g_{fin}$ is measurable.
As we said, we know that the proof of proposition 2.6 promptly adapts to show that if $f,g:X\rightarrow \mathbb{R}$ are measurable then $f+g$ and $fg$ are measurable. So we know that $f_{fin}+g_{fin}$ and $f_{fin}+g_{fin}$ are measurable.
Now, let us prove item a.).
Let $B$ be any Borel set of $\overline{\mathbb{R}}$, we have
\begin{align*}
(fg)^{-1}(B) &= (fg)^{-1}(B\setminus\{-\infty,0,+\infty\})\cup (fg)^{-1}(B\cap\{0\}) \cup \\
&\phantom{==} \cup  (fg)^{-1}(B\cap\{-\infty \}) \cup (fg)^{-1}(B\cap\{ +\infty\}) 
\end{align*}
And we have
\begin{align*}
&(fg)^{-1}(B\setminus\{-\infty,0,+\infty\}) = (f_{fin}g_{fin})^{-1}(B\setminus\{-\infty,0,+\infty\}) \\
&(fg)^{-1}(B\cap\{0\}) = \emptyset \textrm{ or } [f=0]\cup [g=0] \\
&(fg)^{-1}(B\cap\{-\infty \})= \emptyset \textrm{ or } [f=-\infty; g>  0] \cup  [f=+\infty; g<  0] \cup [f> 0;g=-\infty] \cup [f< 0;g=+\infty] \\
&(fg)^{-1}(B\cap\{+\infty \})= \emptyset \textrm{ or } [f=+\infty; g>  0] \cup  [f=-\infty; g<  0] \cup [f> 0;g=+\infty] \cup [f< 0;g=-\infty]
\end{align*}
In all the cases, we have that the four sets $(fg)^{-1}(B\setminus\{-\infty,0,+\infty\})$, $(fg)^{-1}(B\cap\{0\})$, $(fg)^{-1}(B\cap\{-\infty \})$, $(fg)^{-1}(B\cap\{+\infty \})$ are in $M$. So $(fg)^{-1}(B) \in M$. So $fg$ is measurable.
Now, let us prove item b.).  First let assume $\alpha=0$
Given any Borel set $B$ of $\overline{\mathbb{R}}$, we have
\begin{align*}
(f+g)^{-1}(B) &= (f+g)^{-1}(B\setminus\{-\infty,0,+\infty\})\cup (fg)^{-1}(B\cap\{\alpha\}) \cup \\
&\phantom{==} \cup  (fg)^{-1}(B\cap\{-\infty \}) \cup (fg)^{-1}(B\cap\{ +\infty\}) 
\end{align*}
And we have
\begin{align*}
&(f+g)^{-1}(B\setminus\{-\infty,\alpha,+\infty\}) = (f_{fin}+g_{fin})^{-1}(B\setminus\{-\infty,\alpha,+\infty\}) \\
&(fg)^{-1}(B\cap\{0\}) = \emptyset \textrm{ or }  (f_{fin}+g_{fin})^{-1}(\{0\}) \cup [f=+\infty; g=-\infty] \cup [f=-\infty; g=+\infty]  \\
&(fg)^{-1}(B\cap\{-\infty \})= \emptyset \textrm{ or } [f=-\infty; g<+\infty]  \cup [f<+\infty;g=-\infty]  \\
&(fg)^{-1}(B\cap\{+\infty \})= \emptyset \textrm{ or } [f=+\infty; g>-\infty] \cup [f> -\infty;g=+\infty] 
\end{align*}
In all the cases, we have that the four sets $(f+g)^{-1}(B\setminus\{-\infty,0,+\infty\})$, $(f+g)^{-1}(B\cap\{0\})$, $(f+g)^{-1}(B\cap\{-\infty \})$, $(f+g)^{-1}(B\cap\{+\infty \})$ are in $M$. So $(f+g)^{-1}(B) \in M$. So $f+g$ is measurable.
If $\alpha\neq 0$ then define $f+g$ as above (with $\alpha=0$) and add $\alpha \chi_{[f=+\infty; g=-\infty] \cup [f=-\infty; g=+\infty]}$ to $f+g$. Since $\alpha \chi_{[f=+\infty; g=-\infty] \cup [f=-\infty; g=+\infty]}$ is measurable, the result of the addition will also be measurable.
Important Remark:
One might try to prove this exercise by directly mimicing Folland's proof of Proposition 2.6
It will NOT work. Let us follow the steps and see where the argument breaks.
As in the proof of proposition 2.6, we prove that $f\otimes g: X \to  \overline{\mathbb{R}} \times \overline{\mathbb{R}}$ defined by $f\otimes g (x) =(f(x),g(x))$ is $M$ - $B_{\overline{\mathbb{R}} \times \overline{\mathbb{R}}}$-measurable.
Then define $P : \overline{\mathbb{R}} \times \overline{\mathbb{R}} \to \overline{\mathbb{R}}$ where $P(x,y)=xy$, including the rules to treat $-\infty$ and $+\infty$. IF we could prove that $P$ is continuous, then, it would folow that $P$
is $B_{\overline{\mathbb{R}} \times \overline{\mathbb{R}}}$-$B_{\overline{\mathbb{R}} }$-measurable. And so, we would have proved that $fg=P(f \otimes g)$ is  measurable (that is $B_{\overline{\mathbb{R}} }$-$B_{\overline{\mathbb{R}} }$-measurable).
Issue: when we include the rules to treat $-\infty$ and $+\infty$, $P$ is NOT continuous. So if we want to insist on this path we would have to prove directly that $P$ is $B_{\overline{\mathbb{R}} \times \overline{\mathbb{R}}}$-$B_{\overline{\mathbb{R}} }$-measurable (which would lead to an argument similar to the one we used in our proof above of Exercise 2).
The addition $S : \overline{\mathbb{R}} \times \overline{\mathbb{R}} \to \overline{\mathbb{R}}$ where $S(x,y)=x+y$, including the rules to treat $-\infty$ and $+\infty$, has a similar issue.
