Finding a metric to write a vector field as a gradient of a given function Let $M$ be a smooth manifold, and $f$ a smooth function with an isolated local minimum at $p$. Furthermore, let $X$ be a vector field vanishing at $p$ such that for some neighborhood $U$ of $p$, $df_q(X_q)<0$ for all $q\in U\setminus\{p\}$. Is it possible to find a Riemannian metric g on $U$ such that $X|_U=-\text{grad}_gf$? If not, what is a counterexample?
 A: The answer, in general, is no.
The following is a general fact: Let $M$ be a smooth manifold of dimension $n$, let $E\to M$ be a vector bundle of rank $n$, and let $s\in\Gamma(M,E)$ be a smooth section vanishing at $p\in M$. Let $\nabla$ be a linear connection on $E$. Then $s$ is transverse to the zero section at $p$ if and only if we have $$(\nabla_Xs)_p\neq0$$ for every $X\in T_pM$, $X\neq 0$, in other words, iff the endomorphism $X\mapsto(\nabla_Xs)_p$ is invertible.
Now, a Riemannian metric induces an isomorphism of vector bundles between the tangent and cotangent bundles. Transversality of sections is preserved under a bundle isomorphism. Suppose $f$ is Morse. In particular, the Hessian $\nabla^2f$ is non-degenerate at $p$, where $\nabla$ can be any linear connection on $TM$, or equivalently, the section $df$ of the cotangent bundle is transverse to the zero section at $p$. Take any vector field $X$ which vanishes at $p$ and which is not transverse to the zero section. Then no bundle isomorphism carries $X$ to $df$.
