Note: I changed the original question to the one, proposed by Robert Bryant in the comment below as it is better formulated.

Assume there is a metric on a manifold with a closed geodesic such that all nearby geodesics are closed too. What can be said about a metric near this geodesic? We do not require that all the geodesics are closed, so the question is local. A good example is a sphere with a deformed metric near the poles, so all the geodesics near the equator are closed.