Must a one-dimensional conservative system with same period in spite of initial condition be a simple harmonic oscillator? All the non-trivial solutions ( i.e. $x(t)\not\equiv 0$ )  of $$\frac{d^2x}{dt^2} = f(x)$$  has the same period, independent of the initial condition. Without loss of generality, set $$f(0)=0$$Does it imply that $$ f = -kx$$?
If not, what  assumptions should be made to reach this conclusion?
update: What if $f$ is restricted to be an odd smooth (or at least continuous) function, in which case,  we want to determine the continuous diffenrentiable function $F$ such that $$ \int_0^{x_0}\frac{1}{\sqrt{F(x_0)-F(s)}}\mathrm{d}s $$ is a constant, and let $f(x) = - F'(x)$.
 A: The answer is no.
Consider any function $f$
$$
f(x) = \begin{cases} -k_1 x \quad (x \le 0) \\ -k_2 x \quad ( x > 0)
\end{cases}
$$
such that $\frac{1}{\sqrt{k_1}} + \frac{1}{\sqrt{k_2}} = 2$. Solutions of $x''(t) = f(x(t))$ consist of pieces of trigonometric functions that are easy to find. All such solutions have period $2 \pi$. 
A: #

Summary of previous WRONG attempt, to which comments are related, still work in progress:
First of all, we note that the ODE can be physically derived from a conservation of energy (kinetic and potential) equation such as $$ \frac{1}{2} \Big(\frac{\mathrm{d} x}{\mathrm{d}t} \Big)^2– F(x) = F(x_0)  $$ where $F$ is the primitive of $f$, assuming it exists, ($F = \frac{1}{2} k x^2$ for a linear spring law) and $x_0$ is the maximum amplitude reached by the harmonic oscillator.
This makes it easy to calculate the half-period $T$ as
$$ T (x_0)= \frac{1}{\sqrt{2}} \int_0 ^{x_0} \frac{\mathrm{d}s}{\sqrt{F(x_0) – F(s)}}$$
We know that if $F(x) = \frac{1}{2} k x^2$, then $T$ is a constant function.
The question boils then down to, can we find a function $F$, such that $\forall x_0$
$$ T (x_0)= \frac{1}{\sqrt{2}} \int_0 ^{x_0} \frac{\mathrm{d}s}{\sqrt{F(x_0) – F(s)}} = 
\frac{1}{\sqrt{2}} \int_0 ^{x_0} \frac{\mathrm{d}s}{\sqrt{\frac{1}{2}k x_0^2 – \frac{1}{2}k s^2 }}
$$
As the equality is supposed to be valid for any $x_0$, it is implied that the integrands are the same
$$ \frac{1}{\sqrt{F(x_0) – F(x)}} = 
\frac{1 }{\sqrt{\frac{1}{2}k(x_0)^2 – \frac{1}{2}k x^2 }} $$
which is not possible if $F (x) \neq {\frac{1}{2}k x^2 }$

#
