If an ODE has only periodic solutions and one equilibrium point, is that equilibrium point Lyapunov stable? Consider the non-linear IVP
$$\dot x=f(x),$$
$$x(0)=x_0.$$
where $f$ is locally Lipschitz and
$$f(0)=0$$
and $$f(x)\ne 0\ \forall x\ne 0.$$
If all solutions to this IVP for various initial conditions are periodic does that mean that the origin is Lyapunov stable, i.e.,
$$\forall \varepsilon>0, \ \exists\delta>0, \ |x(0)|<\delta\implies|x(t)|<\varepsilon \ \forall t\ge 0.$$
My professor said yes in class and he "justified" this by drawing periodic orbits that are circular. I know that periodic solutions are bounded, but what if a solution close starts very close to the origin, moves far away from the origin, then returns to the same point? Is there an example of such a system or is my professor right?
I was thinking of a solution like
$$x(t)=\begin{cases}\frac{x(0)}{|x(0)|}\sin(t)+x(0)(1-\sin(t))&x\ne 0\\0&x=0\end{cases}.$$
$x(t)$ oscillates between $x(0)$ and a point with norm 1, so no matter how small $\delta$ is, the solution will never satisfy the definition of Lyapunov stability with $\varepsilon=\frac{1}{2}$. The origin is an equilibrium point and the only equilibrium point and $x(t)$ satisfies the initial condition. $x(t)$ is differentiable, $2\pi$ periodic and satisfies the time-invariance property. I know that $x(t)$ does not work because it is not continuous with respect to the initial condition and $f$ is locally Lipschitz but I'm wondering if there is a way to alter $x(t)$ to make it a solution to an autonomous ODE and still have the same properties.
 A: This is not a satisfactory proof of the OP's question.  It's a sketch of a proof of a slightly weaker claim (see assumptions below).  However, since this question hasn't gotten attention from an expert, as I hoped for in a comment above, then I'll write this down as the best that I can do at the moment.  There may be counterexamples to my argument, but I think they would have to be pathological.
One important point: I'm interpreting that the question requires that every point be in a strictly periodic orbit, in the sense that for every initial condition $x(0)$, there will be some $t > 0$ such that $x(t) = x(0)$.  I think that this is the sense in which the OP meant that "all solutions...are periodic."  (A physicist like me might informally say that all solutions are periodic if they asymptotically approach one or more periodic attractors, which is a completely different situation.)
I'll make the following assumptions that are stronger than the OP's question.  These can probably be relaxed, but I have not spent any time trying to do so.

*

*$f$ is differentiable (not just Lipschitz).

*The Jacobian of $f$ at $x=0$, which I'll call $J$, is not identically zero.


Proof: I will try to prove that your professor's picture is essentially correct, i.e., that initial conditions near the origin follow orbits that remain near the origin.  Sufficiently close to the origin,
$$ \dot{x} = f(0) + J x + \dots \approx J x $$
since $f(0)=0$.  This linearization has the solution
$$ x(t) = e^{Jt} x(0) $$
as long as $x(t)$ is sufficiently close to $0$.
The eigenvalues of $J$ are the local Lyapunov exponents.  Note that these can be complex, but since $J$ is real, they must come in complex conjugate pairs; linear combinations of these are used to create real solutions for $x(t)$.  (I will ignore this subtlety below but it doesn't change anything.)  In the next paragraph, I try to show that $\text{Re}(\lambda) = 0$ for all eigenvalues $\lambda$.
Suppose that there is some eigenvector $v$ whose associated eigenvalue $\lambda$ has a negative real component, i.e., $\text{Re}(\lambda) < 0$.  Suppose we let $x(0) = v$.  Then $x(t) = v e^{\lambda t}$, and $x(t)$ will asymptotically approach $0$, a fixed point.  Specifically, $x(t)$ will never return to $x(0)$, which we assumed that it would.  Note that the linearization of the original ODE is still valid within this entire neighborhood, so we can't say that somewhere along the path, it will get swept off in a different direction and complete a periodic orbit without going to $0$.
Dealing with the case that $\text{Re}(\lambda) > 0$ is slightly harder.  This is because, after some time, $x(t)$ will leave the neighborhood where the linearization is valid, and after that we cannot say what will happen.  But here I will employ a trick: Make time go backwards.  Note that a periodic orbit must remain periodic whether time runs forward or backward.  Now consider the original ODE,
$$ \dot{x} = f(x) $$
under the substitution $t \to -t$ (running time backwards). We get the ODE
$$ \dot{x} = -f(x) $$
which corresponds to taking $J \to -J$ and $\lambda \to -\lambda$ in the discussion above.    So if we have $\text{Re}(\lambda) > 0$ when time is running forward, we can run time backward and apply the same argument as we did for $\text{Re}(\lambda) < 0$.
Note that because we can choose the initial condition to be exactly on the eigenvector, the above discussion applies even if $J$ has both positive and negative eigenvalues, because we are singling out the effect of a single eigenvalue.
We have shown that the cases where $x(t)$ move rapidly toward or away from the origin are excluded, so $x(t)$ must remain at approximately the same distance from the origin.  In particular, the eigenvalues of $J$ must be pure imaginary, so $x(t)$ will be a sum of oscillating components.  In particular, if $x(0) = \sum_i c_i v_i$ for eigenvectors $v_i$, then $x(t) = \sum c_i e^{\lambda_i t} v_i$.  Obviously $|x(t)|$ can change, but it is bounded by the triangle inequality.

The main place where this argument needs more rigor is that one would need to do an $\epsilon$-$\delta$ analysis (or invoke relevant theorems) to validate that we really can ignore the effect of the higher-order terms in the Taylor series.  But I think the basic outline is sound.
A: For 2-d only:  Suppose not.  Then there is an $\epsilon >0$ such that there is no such $\delta >0$ with $|x(0)| < \delta \implies |x(t)|<\epsilon$.
Take such an $\epsilon > 0$ and consider a sequence $x_1, x_2, \cdots$ approaching the origin.  By periodicity with equilibrium point $0$, the orbit with initial $x_1$ must exit the $\epsilon$ ball and reenter at least once.  Label the first exit and first reentrance as $E_{1,A}, E_{1,B}$.  Since this orbit encompasses the origin, we can choose the sequence such that each successive point is contained in the interior of the orbit of the previous.  By existence-uniqueness, the orbits origininating from these point cannot cross.  In turn, this then creates sequences of points on the $\epsilon$ ball $E_{i,A}, E_{i,B}$.  These must converge to limit points $E_{\infty,A},E_{\infty,B}$ on the ball.
If $E_{\infty,A} = E_{\infty,B}$, this point is an equilibrium, which contradicts the condition $f(x) \not= 0$.  If not, then consider a point $S$ on the arc of the ball defined by $E_{\infty,A}, E_{\infty,B}$. By index theory, the region enclosed periodic orbit in the plane must contain an equilibrium point. The orbit of $S$ must contain $0$, which contradicts existence-uniqueness from those orbits defined by our sequence.
