Let $f:\mathbb{R}^2 \rightarrow \mathbb{R}$ be a Borel measurable function, and denote with $\lambda$ Lebesgue measure on $\mathbb{R}$. Assume that for every fixed $x \in \mathbb{R}$ the following property holds:
(P) the $x$-section map $\mathbb{R} \ni y \mapsto f(x,y)$ is $\lambda$-a.e. equal to some constant $g(x)$.
Is $g:\mathbb{R} \rightarrow \mathbb{R}$ a Borel measurable function?
What if we replace everywhere "Borel measurable" with "Lebesgue measurable" and assume that (P) holds only for $\lambda$-almost every $x$?
The answers seem to be positive, but I am not so convinced they are. Thank you very much in advance for you help.
PS The following post could be very useful in thinking about this question for those who are not so familiar with properties of product measure: Is f necessarily measurable (see in particular GEdgar's answer).
Ops, I realize only now that my questions are trivial.
Actually, if $f^{+}$ and $f^{-}$ are respectively the positive and negative part of $f$, we have for every $x$ under the first set of assumptions (and for $\lambda$-almost every $x$ under the second set of assumptions) \begin{equation} g(x)=\int_{0}^{1} f(x,y) dy = \phi_1(x) - \phi_2(x), \end{equation} where \begin{equation} \phi_1(x)=\int_{0}^{1} f^{+}(x,y) dy, \end{equation} and \begin{equation} \phi_2(x)=\int_{0}^{1} f^{-}(x,y) dy. \end{equation} Now, $\phi_1$ and $\phi_2$ are Borel measurable (respectively defined $\lambda$-a.e. and Lebesgue measurable) under the first set of assumptions (respectively Lebesgue measurable, under the second set of assumptions) by Fubini's Theorem in its classical version (respectively, in its variant for the completion of product measures): see e.g. Rudin, Real and Complex Analysis, Third Edition, Theorems (8.8) and (8.11).
Sorry for having posted silly questions!