Suppose $f\geq0$ is a measurable function $f:X_1 \times X_2 \rightarrow [0,\infty]$ according to the product measure $\mu_1 \otimes \mu_2$ defined by the $\sigma$-finite measures $\mu_1 :\Sigma_1 \rightarrow [0,\infty]$ and $\mu_2 : \Sigma_2 \rightarrow [0,\infty]$ where $\Sigma_1,\Sigma_2$ are the $\sigma$-algebras over $X_1$ and $X_2$.
The function $g:X_1 \rightarrow [0,\infty]$ is defined as:
$$g(x_1)=\int_{X_2} f(x_1,x_2) d\mu_2 (x_2)$$
My question though stupid it is, is why $g:X_1 \rightarrow [0,\infty]$ is a measurable function.
My stupid attempt
I can write:
$$g(x_1) = \sup_{s\leq f} \left\{\sum^{p_s}_{i=1} \alpha_i \mu_2 (A_i)_2 (x_1)\right\}$$
where $s$ are the simple functions and $A_i \in \Sigma_1 \otimes \Sigma_2$(the sigma algebra generated by the rectangles $M_i \times N_j$ where $M_i \in \Sigma_1$ and $N_j \in \Sigma_2$) and:
$$(A_i)_2 (x_1) := \left\{ x_2 | (x_1,x_2) \in A_i \right\}$$
One knows that if $f_n$ is a sequence of measurable functions then $\sup f_n$ is also a measurable function.
Nonetheless the set of simple functions $s(x_1)= \sum^{p_s}_{i=1} \alpha_i \mu_2 (A_i)_2 (x_1) \leq f(x_1)$ are not countable and I don't even know how to show each of them is a measurable function at all!