Let $(M,g)$ a Riemannian manifold and $X$ a Killing field on $M$. Then, we can define the function:
$$f(p) = \|X(p)\|^2$$
The claim is:
If $p$ is a critical point of $f$ then the flow of $X$ at $p$ is a geodesic.
My attempts:
$$Xf(p) = X(\|X(p)\|^2) = 2g(\nabla_XX(p),X(p)).$$
But then, once $p$ is a critical point then $$g(\nabla_XX(p),X(p)) = 0.$$
But if I am not mistaken the condition of $X$ Killing implies the same. Right?
How to proceed?
I must conclude that $\nabla_XX(p) = 0.$
$0=\frac{1}{2}Vf=g(\nabla_VX,X)= -g(\nabla_XX,V)$ for any $V$
That is $\nabla_XX(p)=0$
As you pointed, $X|X|^2=0$ This implies that $|X|^2$ is constant along a flow That is if $p$ is critical, flow passing through $p$ is set of critical point