The electric field is at \(P\) due to ring is \(E=\frac{1}{4 \pi \epsilon_0} \frac{Q z_0}{\left(R^2+z_0^2\right)^{3 / 2}}\) where \(Q\) is the charge on the ring.
As the ring is positively charged so \(E\) is always directed away from \(O\).
Hence a negatively charged particle is accelerated towards \(O\) and undergoes periodic motion.
i.e \(m a=-\frac{ q }{4 \pi \epsilon_0} \frac{ Qz _0}{\left( R ^2+ z _0^2\right)^{3 / 2}}\)
For \(z_0 \ll R, m a=-\frac{Q q z_0}{4 \pi \epsilon_0 R^3}\). Thus the acceleration \((a)\) is proportional to the \(z-\) coordinate, and the particle undergoes approximate SHM. As \(E\) is directed always away from \(O\) so when particle \(P\) will cross \(O\), again some attractive force will act on it and hence it will not continue to move along negative \(z\)-axis towards \(z=-\infty\).