While looking at this answer https://math.stackexchange.com/a/2111753/72031 could not help wondering about the following implication : $$(f'(x)) ^{2}=(f(x))^{2}\Rightarrow f'(x) =f(x) \text{ or } f'(x) =-f(x) $$ Note that the equation $f'^{2}=f^{2}$ is possible if for some values of $x$ we have $f'(x) =f(x) $ and for other values of $x$ we have $f'(x) =-f(x) $. The linked answer assumes that this will never be the case. It appears that it is not obvious that only one of the alternatives will be true for all values of $x$. I could neither establish this nor find an easy counter-example. So I pose the following problem:
Let $f:\mathbb{R} \to\mathbb{R} $ be such that $f''(x) =f(x)$ for all $x\in\mathbb{R} $ and let $f'(0)=f(0)=0$. Then it is easy to prove that that $(f'(x)) ^{2}=(f(x))^{2}$ for all real $x$. Show that either "$f'(x) =f(x) $ for all real $x$" or "$f'(x) =-f(x) $ for all real $x$" .
Please avoid solutions based on techniques of solving differential equations. Simpler approaches using theorems from elementary calculus are expected.
