Solution (source code)

= Solution

Let $L(x,y,z)=(x-y,y-z,z-x)$. This is a <linear map>, hence smooth; composing it with the given $C^1$ function proves that $g=f\circ L$ is <continuously differentiable> by the <chain rule>. Write $f_1,f_2,f_3$ for the first <partial derivatives>, evaluated at $L(p)$. Then
$$
g_x=f_1-f_3,\qquad g_y=-f_1+f_2,\qquad g_z=-f_2+f_3.
$$
Adding these identities gives
$$
\boxed{g_x(p)+g_y(p)+g_z(p)=0.}
$$
Geometrically, $L(p+t(1,1,1))=L(p)$, so $g$ is constant along every line in the diagonal direction; its <derivative> in that direction must vanish.