Problem Let $[a,b] \subset \mathbb R$ and $f: \mathbb R \to \mathbb R_{\geq 0}$ such that $f=0$ on $[a,b]^c$. Given $h >0$, we define $g: \mathbb R \to \mathbb R_{\geq 0}$ given by $$g(x)=\dfrac{1}{2h}\int_{x-h}^{x+h} f(t)dt$$
Prove that $g$ is measurable and that $$\int_a^b g(x)dx \leq \int_a^b f(x)dx$$
I thought of defining the function $$\phi(x,t)=\dfrac{1}{2h}\chi_{[x-h,x+h]}(t)f(t),$$ so for each $x$, $\phi(x,t)$ is a measurable function of variable $t$ and $g(x)=\int_{\mathbb R} \phi(x,t)dt$
But I have no idea how to deduce from here that $g(x)$ is measurable and how to prove the inequality of the exercise. My idea was to construct a measurable non negative function $T(x,t)$, then apply Fubini so as to be able to affirm that $g(x)=\int_{\mathbb R} T(x,t)dt$, if I could do that, it follows that $g$ is measurable. As for the inequality part, I am still lost.
Any help from hints and suggestions would be greatly appreciated.