Define a representation $U$ of $\mathbf R^{2n}$ on $L^2(\mathbf R^n)$ by $(U_{z,y}g)(w)=g(w+z-y)$. Then we have \begin{align} (g,U_{z,y}g)&=\int_{\mathbf R^n}\overline{g(w)}g(w+z-y)\,dw\\ &=\int_{\mathbf R^n}\overline{g(x-z)}g(x-y)\,dx\\ &=f(z,y). \end{align} Therefore $f$ is a diagonal matrix coefficient of a unitary representation, and as such is well known to be positive-definite.