Consider a geodesic complete Riemannian manifold $M_f$ defined by the level set: $ M_f := \{ x \in \mathbb{R}^n | \, f(x)=0 \} $ and a differentiable function $g:M \rightarrow \mathbb{R}$ which defines the level set $N_g := \{x \in M_f | \, g(x)=0\}$.
What are the additional conditions must satisfy $M_f$ and $N_g$ such that the geodesic curves of $M_f$ cross $N_g$ only at isolated points?