I've been struggling with the following. I'd like to find a numerical scheme to solve the following ODE:
$$ x'' + \frac{1}{x^2} = 0 $$
Most schemes work quite well when $x$ isn't too close to zero, but I need one that is robust to traversing the origin. E.g., I expect that if my initial conditions are $(x, x') = (1, 0)$, the solution would be a kind of oscillator between $1$ and $-1$.
I'm not sure this is even possible to find? I've done some research and tried to find a solution myself, but I'm hitting a wall. Does anyone have some insights on this problem?
Thanks for your help!

Before you look for a numerical scheme, ask whether there is a solution at all. The differential equation is undefined at $x=0$, so there is really no such thing as "traversing the origin" for its solutions. In fact, since $x'' < 0$ everywhere, it is impossible to continue a solution after it hits the origin with velocity $-\infty$, unless you make the velocity jump to $+\infty$. You could, for example, bounce off the origin (so $x(t_0+t) = x(t_0-t)$ where $t_0$ is a time you hit the origin). But if you somehow made it to some $x < 0$ with $x' < 0$, $x'$ will stay negative so you can never go back.
EDIT: In fact, by "conservation of energy", $E(x,v) = \frac{v^2}{2} - \frac{1}{x}$ is conserved, where $v = dx/dt$ is the velocity.
Trajectories in the $(x,v)$ plane look like this.
For positive $x$, solutions can come from $x \to 0, v \to +\infty$ at some finite time in the past and go back with $x \to 0, v \to -\infty$ at some finite time in the future, or come from $(0, +\infty)$ and go to $x \to +\infty$ as $t \to +\infty$, or come from $x \to +\infty$ as $t \to -\infty$ and go to $(0,-\infty)$. For negative $x$, solutions must come from $x \to -\infty, v \to const > 0$ as $t \to -\infty$ and go back to $x \to -\infty$, $v \to -const < 0$ as $t \to +\infty$ without ever approaching $x=0$.