Suppose that $g:\mathbb{R}^{2n}\rightarrow\mathbb{R}$ is a function such that:
$$f\left(x,x\right)\left[\nabla_{x}^{2}g\left(x,y\right)\right]_{x=y}+2\left[\nabla_{x}f\left(x,y\right)\right]_{x=y}\cdot\left[\nabla_{x}g\left(x,y\right)\right]_{x=y}=0$$
holds for all $f:\mathbb{R}^{2n}\rightarrow\mathbb{R}$. Here $x$ and $y$ denote points in $\mathbb{R}^{n}$.
The properties that interest me are:
Does it follow that $g$ satisfies $\left[\nabla_{x}^{2}g\left(x,y\right)\right]_{x=y}=0$ ?
Does it follow that $g$ satisfies $\left[\nabla_{x}g\left(x,y\right)\right]_{x=y}=0$ ?
Note: I am only considering smooth functions $f$ and $g$ here.
Since this is holding for every $f$, let's take $f = 1$. It answers the first question.
Then take $f(x,y) = x$, it answers the second question.