If $\nabla f(x,y,z) $ is always parallel to $xi+yj+zk$, them $f$ must be equal values at the points $(0,0,a)$ and $(0,0,-a)$. If $\nabla f(x,y,z) $ is always parallel to $xi+yj+zk$, them $f$ must be equal values at the points $(0,0,a)$ and $(0,0,-a)$.
I am having difficulty in the problem. Please help.
 A: Suppose that we are given $\nabla f=C\vec r$, where $\vec r$ is the position vector and $C$ is a constant of proportionality.
Then, by integration, we find that $f$ is given by
$$f(x,y,z)=\frac12 C(x^2+y^2+z^2)+C'$$
where $C'$ is an integration constant.
Evaluating $f$ at $(0,0,a)$ and $(0,0,-a)$ reveals that
$$f(0,0,a)=\frac12Ca^2+C'$$
and
$$\begin{align}
f(0,0,-a)&=\frac12 C(-a)^2+C'\\\\
&=\frac12 Ca^2+C'\\\\
&=f(0,0,a)
\end{align}$$
as was to be shown!


EDIT:
If $C$ is a function of $x$, $y$, and $z$, then the result fails to hold in general.  For example, suppose $\nabla f =z\vec r$.  Then, we have
$$\begin{align}
f(0,0,a)-f(0,0,-a)&=\int_{-a}^a \nabla f(0,0,z)\cdot \hat z\,dz\\\\
&=\int_{-a}^a z^2\,dz\\\\
&=\frac23a^3\\\\
&\ne 0
\end{align}$$
However, if $C(x,y,z)$ is an even function of $z$, then we have
$$\begin{align}
f(0,0,a)-f(0,0,-a)&=\int_{-a}^a \nabla f(0,0,z)\cdot \hat z\,dz\\\\
&=\int_{-a}^a zC(0,0,z)\,dz\\\\
&=0
\end{align}$$
and we obtain the proposed result.
A: Here $C$ might not be a constant.
example- take $f(x,y,z)=e^{x^2+y^2+z^2}$
