Let $(X, A)$ and $(Y,B)$ be two measurable space. Let $f \geq 0$ be measurable w.r.t $A \times B$ (product $\sigma$ -algebra). Let $g(x)=\sup_{y \in Y} f(x,y)$ and suppose $g(x)< \infty$ for each $x$. Is g necessarily measurable w.r.t $A$?
I am not sure whether the answer is no or yes. But, I haven't been able to produce a proof. Thanks in advance for any help!