Solution (source code)

= Solution

Use <metric signature> $(-,+,+,+)$ and a future-oriented worldline. Variation of the <worldline einbein> gives the <mass-shell condition>; variation of momentum gives
$$
p^2+m^2=0,\qquad \dot x^\mu=e\,g^{\mu\nu}p_\nu.
$$
Eliminating $p$ first leaves $L=\dot x^2/(2e)-em^2/2$. Its $e$ equation is $\dot x^2=-e^2m^2$. Choose the positive lapse branch $e=\sqrt{-\dot x^2}/m$; substituting gives $L=-m\sqrt{-\dot x^2}$. \b[Thus $\boxed{S=-m\int\sqrt{-g_{\mu\nu}dx^\mu dx^\nu}=-m\int d\tau}$], the <proper time> action. The lapse branch fixes the sign convention. Eliminating auxiliary variables on their algebraic equations preserves the worldline equations, which are timelike <geodesics> up to parametrization.