Solution (source code)

= Solution

Under <spatial reflection>, $\phi'(t,\mathbf x)=\gamma_p\phi(t,-\mathbf x)$, so
$$
\partial_0\phi'(t,\mathbf x)=\gamma_p\partial_0\phi(t,-\mathbf x),
\qquad
\partial_i\phi'(t,\mathbf x)=-\gamma_p\partial_i\phi(t,-\mathbf x).
$$
Because $\gamma_p^2=1$, the Lorentz scalar $\partial_\mu\phi\partial^\mu\phi$ and the mass term $m^2\phi^2$ are unchanged after evaluating at the reflected point. The spatial change of variables $\mathbf x\mapsto-\mathbf x$ has unit absolute Jacobian, so the action of the free <real scalar field> is invariant.