Let $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ be a Borel measurable function. Define $$g(y) = \begin{cases} \frac{\displaystyle \int_{\mathbb{R}} x f(x,y) dx}{\displaystyle \int_{\mathbb{R}} f(x,y) dx} & \text{if } \displaystyle \int_{\mathbb{R}} f(x,y) dx >0,\\ \\0 & \text{if } \displaystyle \int_{\mathbb{R}} f(x,y) dx =0.\end{cases}$$ Can we say that $g$ is also measurable?
I know that if $f(x,y)$ is measurable $y \mapsto \displaystyle \int_{\mathbb{R}} f(x,y) dx $ is measurable, but what can be said about $y \mapsto \displaystyle \int_{\mathbb{R}} x f(x,y) dx $ ?