[proofplan]
We first package the two functions into the product map $x\mapsto (f(x),g(x))$, which is measurable by the measurability of pairs. Then we compose this product map with the continuous arithmetic maps on $\mathbb{R}^2$ to obtain measurability of sums and products. The absolute value, maximum, and minimum follow by composing with continuous real-valued maps. For the quotient, the nowhere-zero hypothesis lets us regard $g$ as a measurable map into $\mathbb{R}\setminus\{0\}$ and then compose with the continuous reciprocal map.
[/proofplan]
custom_env
admin
[step:Package $f$ and $g$ into a measurable pair]
Define the product map $h:X\to\mathbb{R}^2$ by $h(x)=(f(x),g(x))$ for every $x\in X$. Since $f$ and $g$ are measurable as maps from $(X,\mathcal{M})$ to $(\mathbb{R},\mathcal{B}(\mathbb{R}))$, [citetheorem:8507] applied with $E=G=\mathbb{R}$ and $\mathcal{E}=\mathcal{G}=\mathcal{B}(\mathbb{R})$ gives that
$h:(X,\mathcal{M})\to(\mathbb{R}^2,\mathcal{B}(\mathbb{R})\otimes\mathcal{B}(\mathbb{R}))$
is measurable. We use the standard identification $\mathcal{B}(\mathbb{R}^2)=\mathcal{B}(\mathbb{R})\otimes\mathcal{B}(\mathbb{R})$.
[/step]
custom_env
admin
[step:Compose the pair with continuous addition and multiplication maps]Define the addition map $A:\mathbb{R}^2\to\mathbb{R}$ by $A(u,v)=u+v$, and define the multiplication map $P:\mathbb{R}^2\to\mathbb{R}$ by $P(u,v)=uv$. Both $A$ and $P$ are continuous. Hence, by [citetheorem:8506], both maps are $\mathcal{B}(\mathbb{R}^2)/\mathcal{B}(\mathbb{R})$-measurable.
The compositions $A\circ h:X\to\mathbb{R}$ and $P\circ h:X\to\mathbb{R}$ are therefore measurable. For every $x\in X$,
\begin{align*}
(A\circ h)(x)=A(f(x),g(x))=f(x)+g(x)
\end{align*}
and
\begin{align*}
(P\circ h)(x)=P(f(x),g(x))=f(x)g(x).
\end{align*}
Thus $f+g$ and $fg$ are measurable.[/step]
custom_env
admin
[guided]The reason for introducing $h$ is that addition and multiplication are naturally functions of two real variables. Define $h:X\to\mathbb{R}^2$ by $h(x)=(f(x),g(x))$. The previous step proved that $h$ is measurable from $(X,\mathcal{M})$ into $(\mathbb{R}^2,\mathcal{B}(\mathbb{R}^2))$.
Now define $A:\mathbb{R}^2\to\mathbb{R}$ by $A(u,v)=u+v$. This map is continuous, so [citetheorem:8506] gives that $A$ is Borel measurable. Since $h$ is measurable and $A$ is measurable, the composition $A\circ h:X\to\mathbb{R}$ is measurable. Evaluating the composition gives
\begin{align*}
(A\circ h)(x)=A(f(x),g(x))=f(x)+g(x)
\end{align*}
for every $x\in X$. Hence $f+g$ is measurable.
The same argument applies to multiplication. Define $P:\mathbb{R}^2\to\mathbb{R}$ by $P(u,v)=uv$. The map $P$ is continuous, so [citetheorem:8506] implies that $P$ is Borel measurable. Therefore $P\circ h:X\to\mathbb{R}$ is measurable. For every $x\in X$,
\begin{align*}
(P\circ h)(x)=P(f(x),g(x))=f(x)g(x).
\end{align*}
Thus $fg$ is measurable.[/guided]
custom_env
admin
[step:Obtain measurability of the absolute value]
Define the absolute-value map $B:\mathbb{R}\to\mathbb{R}$ by $B(t)=|t|$. The map $B$ is continuous, hence Borel measurable by [citetheorem:8506]. Since $f:X\to\mathbb{R}$ is measurable, the composition $B\circ f:X\to\mathbb{R}$ is measurable. For every $x\in X$,
\begin{align*}
(B\circ f)(x)=|f(x)|.
\end{align*}
Therefore $|f|$ is measurable.
[/step]
custom_env
admin
[step:Compose the pair with continuous maximum and minimum maps]
Define $M:\mathbb{R}^2\to\mathbb{R}$ by $M(u,v)=\max\{u,v\}$, and define $N:\mathbb{R}^2\to\mathbb{R}$ by $N(u,v)=\min\{u,v\}$. These maps are continuous, since
\begin{align*}
M(u,v)=\frac{u+v+|u-v|}{2}
\end{align*}
and
\begin{align*}
N(u,v)=\frac{u+v-|u-v|}{2}.
\end{align*}
By [citetheorem:8506], $M$ and $N$ are Borel measurable. Since $h:X\to\mathbb{R}^2$ is measurable, the compositions $M\circ h:X\to\mathbb{R}$ and $N\circ h:X\to\mathbb{R}$ are measurable. For every $x\in X$,
\begin{align*}
(M\circ h)(x)=\max\{f(x),g(x)\}
\end{align*}
and
\begin{align*}
(N\circ h)(x)=\min\{f(x),g(x)\}.
\end{align*}
Thus $\max\{f,g\}$ and $\min\{f,g\}$ are measurable.
[/step]
custom_env
admin
[step:Use the nowhere-zero hypothesis to prove measurability of the quotient]Assume now that $g(x)\ne 0$ for every $x\in X$. Let $\mathbb{R}^{\times}:=\mathbb{R}\setminus\{0\}$, equipped with its subspace Borel $\sigma$-algebra $\mathcal{B}(\mathbb{R}^{\times})$. Define $\widetilde{g}:X\to\mathbb{R}^{\times}$ by $\widetilde{g}(x)=g(x)$ for every $x\in X$.
We first verify that $\widetilde{g}$ is measurable. If $C\in\mathcal{B}(\mathbb{R}^{\times})$, then there exists $D\in\mathcal{B}(\mathbb{R})$ such that $C=D\cap\mathbb{R}^{\times}$. Since $g(X)\subset\mathbb{R}^{\times}$,
\begin{align*}
\widetilde{g}^{-1}(C)=g^{-1}(D).
\end{align*}
Because $g$ is measurable, $g^{-1}(D)\in\mathcal{M}$. Hence $\widetilde{g}$ is measurable.
Define the reciprocal map $R:\mathbb{R}^{\times}\to\mathbb{R}$ by $R(t)=1/t$. The map $R$ is continuous on $\mathbb{R}^{\times}$, so [citetheorem:8506] implies that $R$ is $\mathcal{B}(\mathbb{R}^{\times})/\mathcal{B}(\mathbb{R})$-measurable. Therefore $R\circ\widetilde{g}:X\to\mathbb{R}$ is measurable, and for every $x\in X$,
\begin{align*}
(R\circ\widetilde{g})(x)=\frac{1}{g(x)}.
\end{align*}
By the already proved product case, applied to the [measurable functions](/page/Measurable%20Functions) $f$ and $R\circ\widetilde{g}$, the product $f(R\circ\widetilde{g})$ is measurable. For every $x\in X$,
\begin{align*}
f(x)(R\circ\widetilde{g})(x)=\frac{f(x)}{g(x)}.
\end{align*}
Thus $f/g$ is measurable.[/step]
custom_env
admin
[guided]The only additional issue for the quotient is that the reciprocal function is not continuous on all of $\mathbb{R}$. The hypothesis $g(x)\ne 0$ for every $x\in X$ lets us restrict the codomain of $g$ to the punctured real line. Let $\mathbb{R}^{\times}:=\mathbb{R}\setminus\{0\}$, equipped with the Borel $\sigma$-algebra inherited from the [subspace topology](/page/Subspace%20Topology), and define $\widetilde{g}:X\to\mathbb{R}^{\times}$ by $\widetilde{g}(x)=g(x)$.
We must check that $\widetilde{g}$ is measurable with this smaller codomain. Let $C\in\mathcal{B}(\mathbb{R}^{\times})$. By the definition of the subspace Borel $\sigma$-algebra, there is a set $D\in\mathcal{B}(\mathbb{R})$ such that $C=D\cap\mathbb{R}^{\times}$. Since the values of $g$ all lie in $\mathbb{R}^{\times}$, the preimage of $C$ under $\widetilde{g}$ is exactly the preimage of $D$ under $g$:
\begin{align*}
\widetilde{g}^{-1}(C)=g^{-1}(D).
\end{align*}
Because $g:(X,\mathcal{M})\to(\mathbb{R},\mathcal{B}(\mathbb{R}))$ is measurable, $g^{-1}(D)\in\mathcal{M}$. Therefore $\widetilde{g}$ is measurable as a map into $\mathbb{R}^{\times}$.
Now define $R:\mathbb{R}^{\times}\to\mathbb{R}$ by $R(t)=1/t$. This map is continuous on $\mathbb{R}^{\times}$, so [citetheorem:8506] gives that $R$ is Borel measurable. Since $\widetilde{g}$ is measurable, the composition $R\circ\widetilde{g}:X\to\mathbb{R}$ is measurable. Pointwise,
\begin{align*}
(R\circ\widetilde{g})(x)=\frac{1}{g(x)}.
\end{align*}
Finally, we already proved that the product of two measurable real-valued functions is measurable. Applying that result to $f$ and $R\circ\widetilde{g}$ shows that $f(R\circ\widetilde{g})$ is measurable. For every $x\in X$,
\begin{align*}
f(x)(R\circ\widetilde{g})(x)=\frac{f(x)}{g(x)}.
\end{align*}
Hence $f/g$ is measurable.[/guided]
custom_env
admin
[step:Collect the conclusions]
The preceding steps prove that $f+g$, $fg$, $|f|$, $\max\{f,g\}$, and $\min\{f,g\}$ are measurable real-valued functions on $(X,\mathcal{M})$. Under the additional assumption that $g$ is nowhere zero, the final step proves that $f/g$ is also measurable. This is exactly the asserted algebra closure of measurable real-valued functions.
[/step]