$\int_{\mathbb{R}}|f(t)|^2dt=\int_{\mathbb{R}}|f'(t)|^2dt$ implies $f(t)=\mathbb{x}_{i}|f(t)|$ Let $f \in C^{1}(\mathbb{R},\mathbb{R}^m)$ be such that $f$ and $f'$ are square integrable and
$$\{t:f(t)=0\} \subset \{t:f'(t)=0\}$$
$$ |\{t:f(t)=0\}|=n\in \mathbb{N}$$
Prove that if $\int_{\mathbb{R}}|f'(t)|^2\, dt=\int_{\mathbb{R}}|f|'^2(t)\,dt$, then there are $n+1$ points
$$\mathbb{x}_{1},\mathbb{x}_{2},...,\mathbb{x}_{n+1}\in S^{m-1}=\{\mathbb{x}\in \mathbb{R}^m:|\mathbb{x}|=1\} $$
such that for each $t \in \mathbb{R}$, $f(t)=\mathbb{x}_{i}|f(t)|$ for some $i$.
I got this problem from Postech Math Competition.
Thanks in advance.
 A: Here's a sketch. Transform to polar coordinates. Write $f(t) = r(t) \eta(t)$, where $r \colon \mathbb{R} \to [0,\infty)$ and $\eta(t) \in S^{m-1}$. Then
$$|f|'(t) = r'(t), \quad |f'(t)|^2 = |r'(t) \eta(t) + r(t) \eta'(t)|^2 = |r'(t)|^2 + r(t)^2 |\eta'(t)|^2$$ because $\eta \perp \eta'$. Hence our condition becomes
$$\int r'^2(t) \, dt = \int r'^2(t) + r(t)^2 |\eta'(t)|^2 \, dt,$$
which implies that $r(t)\eta'(t) = 0$ for all $t$. Thus either $r(t) = 0$, in which case we are on one of the $n$ points where $f(t) = 0$, or $\eta'(t) = 0$, in which case we stay on the same line. Since there are $n+1$ segments separated by the $n$ points, there are at most $n+1$ different lines we stay on.
A: We have $ a_1<a_2<...<a_n \in \mathbb{R} $ such that $ f(a_i) = f'(a_i) = 0 $ and $f$ is non zero everywhere else. Let $I_1 = (-\infty,a_1), I_{j+1} = (a_j,a_{j+1}) $ for $ 1\leq j\leq n-1 $ and $I_{n+1} = (a_n,\infty) $.  Now if $ f = (f_1,....,f_m) $ then $ |f| = \sqrt{f_1^2+f_2^2+...f_m^2} $, hence $f$ is differentiable in $\cup_j I_j $ and 
$$ |f|' = \frac{2f_1f_1' + ...+2f_mf_m'}{2\sqrt{f_1^2+...+f_m^2}} = \frac{f.f'}{|f|} $$
Thus Cauchy-Swartz Inequality gives that $ |f|'^2\leq |f'|^2 $. So $ |f'|^2-|f|'^2 \geq 0 $ for $ f\neq 0 $, is continuous and non-negative for $ t \neq a_i $. But if we have as given
$$ \int_\mathbb{R} (|f'(t)|^2-|f|'(t)^2 )dt = 0 $$ We can conclude from above that $ |f|'^2 = |f'|^2 $ in $\cup_jI_j $ hence equality for the C-S inequality holds except at those $n $ points. Thus we have $ \lambda_j \in \mathbb{R} $ such that $ f' = \lambda_j f $ in $ I_j $(from linear independence) and hence $|f|' = \lambda_j|f| $. Now we have a piecewise differentiable function $ g : \mathbb{R} \rightarrow S^{m-1}\cup \{0\} $ defined as 
$$ g = \begin{cases} f/|f| &\mbox{if } f \neq 0 \\
0 & \mbox{if } f = 0 \end{cases} $$
So in $I_j$ we have 
$$ g' = \frac{|f|f'-f|f|'}{|f|^2} = \frac{\lambda_j|f|f-\lambda_j|f|f}{|f|^2} = 0 $$
So $ g $ is piecewise constant,i.e there exists $ x_1,x_2,...,x_{n+1} $ such that $ g(t) = x_j $ for $ t \in I_j$. Thus $ f(t) = x_j|f(t)| $ for some $j$ for all $ t \in \mathbb{R} $.
