Claim:
Let $h\in L^{\infty}$ and suppose that $\forall g\in L^1$ and $\forall a\in \mathbb{R}$, $$\int g(x)[ h(x+\alpha)-h(x)]dx=0.$$ Then $h$ is constant a.e. $x\in [-n,n]$.
Here is my attempt:
Fix $n\in \mathbb{N}$ and assume $h$ is continuous. For fixed $g$ and $\alpha$, Holder's inequality gives equality and so we have $$h(x+\alpha)=h(x)\ a.e.\ x\in [-n,n]$$ on the set where $g$ does not vanish. Letting $g=\chi_{[-n,n]}$ we see that $h(x+\alpha)=h(x)$. Enumerate the rationals by $\{r_i\}$ and let $$E_{i}=\{x:h(x+r_i)=h(x)\}\cap[-n,n].$$ Then $[-n,n]\setminus E_i=F_i$ is a null set for each $i$. In particular $\cup F_i$ is null. Since $$[-n,n]=\cap E_i\bigcup \cup F_i$$ $\cap E_i$ is a set with positive measure. Choose $y\in \cap E_i$. Then let $c=h(y)$ and note that $c=h(r_i+y)$ for each $i$. By continuity it follows that for any $x\in[-n,n]$ the claim holds. Since $n$ was arbitrary the claim follows for continuous $h$.
Let $h$ be any $L^\infty$ that satisfies the hypothesis and consider $[-n,n]$ for a fixed $n$. We restrict to the finite measure space on $[-n,n]$. $h$ is integrable on this measure and so we can approximate it by elements in $C[-n,n]$ in the $L_1$ sense. Indeed simple functions are finite linear combinations of characteristic functions and these can be approximated in the $L_1$ sense by continuous functions. Moreover, convergence in $L_1$ yields a subsequence that converges $a.e.$ to $h$. Thus we can obtain a sequence of continuous functions that converge ptwise to $h$. By Ergoroff's Thm we have uniform convergence on a set $E_n$ with $m_{|_{[-n,n]}}E_n^c<1/n.$
Then $h$ is continuous on $E_n$ and the previous argument holds: $$ h(x)=c\ \ \forall x\in E_n\subset [-n,n]\ \text{ and } m([-n,n]\cap E_n^c)<1/n.$$ Letting $n\to\infty$ the claim holds.
Does this suffice? Is there a simpler way to do this that I do not see?