# Composition of measurable functions

Consider a locally bounded function $f: X \times W \rightarrow X$, where $X \subseteq \mathbb{R}^n$, $W \subseteq \mathbb{R}^m$, such that

for all $x \in X$ the function $w \mapsto f(x,w)$ is (Borel) measurable;

Consider a locally bounded, (Borel) measurable, function $g: W \rightarrow X$.

Say if the function

$$(w,v) \mapsto f( g(w), v )$$

is (Borel) measurable as well.

Notes: this question differs from both this and that post.

-
Here‌​: if $f: \mathbb{R} \rightarrow \mathbb{R}$ is Borel measurable and $g: \mathbb{R}^m \rightarrow \mathbb{R}$ is Borel measurable then $f \circ g$ is Borel measurable as well. Can we generalize that? –  Adam Jun 29 '12 at 1:00
Also in $\mathbb{R}^n$, the composition of two Borel mappings is a Borel mapping as well [Bogachev - Measure Theory, pag. 146]. –  Adam Jun 29 '12 at 1:25

What you are trying to prove does not hold. Let $V$ be the Vitali Set which is not measurable in $B(\mathcal{R})$. Let $f: R^{2} \mapsto R$, such that:
$$f(x,y) = \left\{ \begin{array}{ll} 1 & \mbox{x \in V};\\ 0 & \mbox{x \notin V}.\end{array} \right.$$
Note that $f$ is locally bounded and for any $x \in R$, $y \mapsto f(x,y)$ is Borel measurable, since it is constant. Let $g$ be the identity function. Observe that $f(g(x),y) = f(x,y)$ which is not measurable in $(R^{2},B(\mathcal{R}^{2}))$.
Why $f$ is measurable? –  Adam Jun 29 '12 at 2:42
Also, if $g$ is from $W$ to $X$ how can it be the identity? –  Adam Jun 29 '12 at 3:28
f is not measurable... but you didn't say it had to be. Consider $W = X$, for this example. –  madprob Jun 29 '12 at 4:02
I mean why for all $x \in X$ we have $w \mapsto f(x,w)$ measurable? –  Adam Jun 29 '12 at 4:06
If $x \in A$, $w \mapsto f(x,w) = 1$ which is measurable. If $x \notin A$, $w \mapsto f(x,w) = 0$, which is measurable. –  madprob Jun 29 '12 at 4:09