Measurable functions on product measures Let $ (X,\mu) $ be a measure space, and consider $X \times X$ with the product measure $\mu \times \mu $. Consider two functions $f$ and $g$ defined on $X \times X$ such that:


*

*$f$ is measurable.

*For a.e. x, the function $y \to g(x,y)$ is measurable.

*The function $\int g(x,y) dy$ is a measurable function of x.

*For a.e. x, $\int f(x,y) dy = \int g(x,y) dy $.


Is this data sufficient to imply that $g$ is measurable as well? and that $f=g$ a.e.?
Thank you in advance!

No.
Take $X = [-1,1]$, and $\mu$ to be Lebesgue measure $m$.  Let $E$ be a non-measurable subset of $[-1,1]$, and define $g$ by
$$g(x,y) = \begin{cases} 2\cos(\pi y), && x \in E \\
 \cos(\pi y), && x \notin E.
\end{cases}$$
For each $x$, we have that $y \mapsto g(x,y)$ is measurable, and in fact $\int_X g(x,y)\,dy = 0$, so properties 1-4 are satisfied with $f=0$.  But $g$ is not measurable: the set where $g > 1$ is $E \times (-\frac{1}{3}, \frac{1}{3})$ which is not a measurable subset of the square.
Note also that even if $g$ is measurable and satisfies 1-4, it does not follow that $f=g$ almost everywhere: replace $E$ in the above example by $[0,1]$.
Moral: you can't learn very much about a function by looking at what you get after integrating out one variable.
