Lets consider the integral curve $\gamma: I \to \mathbb R^n$ of the vector field $X$, where $I$ is an interval. That is, $\gamma'(t) = X(\gamma(t))$ for all $t\in I$. Suppose $|\gamma(t_0)|=1$ for some $t_0 \in I$. We want to show that $|\gamma(t)|=1$ for all $t\in I$.
Consider $f(t) = \langle \gamma(t),\gamma(t)\rangle$.
We have to show that $f(t) = 1$ for all $t\in I$. Notice that $f'(t) = 2\langle \gamma'(t), \gamma(t) \rangle$. Since $\gamma'(t) = X(\gamma(t))$ we have $$f'(t) = \langle X(\gamma(t)),\gamma(t) \rangle,$$ which is $0$ by hypothesis. So we have $f' = 0$ on the interval $I$ and therefore $f$ is constant. Since $f(t_0)=1$, we conclude $f(t)= 1$ for all $t\in I$. Therefore, $\gamma(t)\in \mathbb S^{n-1}$ for all $t\in I$.