questions from Halmos' "Measure Theory" These questions comes from theorem 19.C, page 81-82, in Halmos' Measure Theory, as the image below shows.

Question 1): The 4th line of the proof says "we restrict our attention to finite valued functions" and the proof is carried out for finite f and g. Why can we "restrict our attention to finite valued functions"? How to extend the conclusion from finite case to extended real valued case?
Question 2): Measurable functions, by definition in page 76-77, are defined on the whole X. But it is possible that f + g has no definition at some point x of X, e.g. $f(x)=+\infty$ but $g(x)=-\infty$. The product fg has the same situation. Of course we can assume in advance that f + g must be defined on the whole X in order for the theorem to hold, but violation of such an assumption occurs immediately: in the equation in the last line of the proof, $fg=[(f+g)^2-(f-g)^2]/4$, even if we assume f + g is defined on the whole X, we cannot guarantee that f - g and $(f+g)^2-(f-g)^2$ is meaningful for all x in X; in the paragraph that follows the proof, $f^+=f\cup 0=(f+|f|)/2$, if $f(x)=-\infty$ for some x, we cannot apply the theorem to obtain the measurability of (f+|f|)/2 and in turn of $f^+$ because f+|f| is not definable on whole X.
So we have to allow that f + g (and fg) has domain smaller than X, but this violates the definition of measurable function in page 76-77. What, then, does the conclusion of the theorem "so also are f + g and fg" mean exactly on earth? and how to apply it to $fg=[(f+g)^2-(f-g)^2]/4$ and $f^+=(f+|f|)/2$?
Thanks!
 A: too long to be a comment, so I have to post it as an answer.
@Arturo Magidin: Do you mean: by "throw away" points where f and g are not defined or take infinite value, we do not need to abide by the requirement in the  definition of measurable function in page 76-77 of this book that the domain of f be the whole X? We only need to grasp the essential idea that $N(f)\cap f^{-1}(M)$ is measurable for all extended Borel set M, that is, in particular, $f^{-1}(\{+\infty\}), f^{-1}(\{-\infty\})$ and $N(f)\cap f^{-1}(M)=f^{-1}(M-\{0\})$ is measurable for all real Borel set M, without caring if f + g and fg are definable on whole X. I think this is what I should learn from this theorem. So, denoting $F=[(f+g)^2-(f-g)^2]/4$ from the last line of the proof or (f+|f|)/2 for $f^+$, after checking inverse images of $\{+\infty\}$ and $\{-\infty\}$, since for any real subset E we have $(fg)^{-1}(E)$ or $(f^+)^{-1}(E)=F^{-1}(E)$ which lie in the subset of X where both f (x) and g (x) are defined and finite (note this subset is contained in the actual domain of F which may be smaller than X), we have $(fg)^{-1}(M-\{0\})$ and $(f^+)^{-1}(M-\{0\})=F^{-1}(M-\{0\})$ are measurable. For product fg, this is what we want, although fg is not necessarily definable for the whole X. For $f^+$, this completes the proof that $f^+$ is a measurable function. Then my second question is therefore answered. Is the above words what your reply intended and correct, Prof Magidin?
PS: Note that $(f+g)^{-1}(\{+\infty\})=[f^{-1}(\{+\infty\})\cap g^{-1}((-\infty,+\infty])]\cup[g^{-1}(\{+\infty\})\cap f^{-1}((-\infty,+\infty])]$ which is measurable by the 3rd paragraph in page 77. We also need to prove that $N(f+g)=[N(f)\cup N(g)]-C$ where $C=\{x|f(x)=-g(x)\}$ is measurable to apply Theorem 19.A. Because $C\subseteq N(f)\cup N(g)$, so $C=[N(f)\cup N(g)]\cap C$ which  is measurable by Theorem 19.A, so N (f + g) is measurable. Note that C may contain (all) points that f + g is not meaningful.
A: I see no explicit requirement on pages 76-77 that the function be defined on all of $X$, though I agree that it does seem implicit. It seems to me that the obvious interpretation here is that the statement says that the natural domain of $f+g$ is a measurable subset,  and the function is measurable on the domain. Likewise with $fg$, which may not be defined at points where one of the two is $\pm\infty$ and the other is $0$. Also, I did not say anything about points where $f$ or $g$ are not defined. So, what do I mean?
For $f+g$: Let $M=f^{-1}(\infty)$, $N=f^{-1}(-\infty)$, $K=g^{-1}(\infty)$, and $L=g^{-1}(-\infty)$. Each is measurable, since $f$ and $g$ are measurable. Now let $Y = X - ((N\cap  K)\cup (M\cap L))$. This is the natural domain of $f+g$, and is measurable. Consider first the restrictions to $Y-(M\cup N\cup K\cup L)$, applying the proof given. Then you work out $(f+g)^{-1}(\infty)$ and $(f+g)^{-1}(-\infty)$ directly in terms of $K$, $L$, $M$, and $N$ (and other sets) to get that $f+g$ is measurable on its natural domain. A similar argument, being careful with the case $f(x)=0$ and $g(x)=0$ this time, will yield the case of $fg$. 
As to Question 2, since Halmos is assuming throughout that $f(x)$ and $g(x)$ are finite valued functions, the situation does not arise: the equation involves only finite quantities and all operations are defined. This handles the situation in $X-(K\cup L\cup M\cup N)$. Then you need to consider the situation when you are working in $(M\cup N)\cap g^{-1}(0)$, $(M\cup N)\setminus g^{-1}(0)$, and the remaining two cases. 
