In classical mechanics we often use the relation $a=v(dv/dx)$ to help solve differential equations. I assume when we write $dv/dx$, we really mean $dV/dx$, where $V$ is a function defined so that $V(x(t))=v(t)$. But then $V$ is not really a well defined function, because a particle can pass through a point more than once, with a different velocity each time. I assume the answer has something to do with the implicit function theorem, which I haven't really studied, but I understand that we can locally treat $V$ as a function of $x$. But then why don't we run into issues treating this as a "global" expression?
Edit: I understand the heuristic use of the chain rule: $a=(dv/dx)(dx/dt)$. But it seems to me that the term $dv/dx$ only makes sense "locally." Yet when we use $a=(dv/dx)(dx/dt)$ to solve, say, the equation of motion of the simple pendulum as an elliptic integral, we end up with an expression valid for all $t$, not just "locally". Why does everything work out?