Let $(M, g)$ be a compact Riemannian manifold and $f: M \rightarrow \mathbb{R}$ be a Morse-Bott function, i.e. the set a critical points of $f$, $Crit(f)$, has connected components which are smooth manifolds and which have as tangent spaces $T_x Crit(f) = \ker \nabla^2_x f$,
(where $\nabla^2_x f: T_x M \rightarrow T_xM$ is the linear operator obtained via $g$ from the hessian $f_{**,x} : T_x M \times T_x M \rightarrow \mathbb{R}$ defined as $f_{**,x}(v, w) = v(W(f))$ for $W \in \Gamma(TM)$ any extension of $w$ (this is well defined and symmetric at critical points) )
Let $\nabla f \in \Gamma(TM)$ be defined by $g(\nabla f, w) = w(f)$ and consider the flow of $-\nabla f$ denoted $\phi_t(y)$. I am trying to see why for any $y \in M$ it happens that $\lim\limits_{t \rightarrow \infty} \phi_t(y) \in Crit(f)$.
My attempt:
Since $M$ is compact, $\phi_t(y)$ is defined for all $t \in \mathbb{R}$. If the set $A_y:= \{ \phi_t(y) : t \in \mathbb{R} \}$ were closed, then, since $M$ is compact, this set would also be compact, and by Weierstrass $f$ would have to attain its minimum on it. Since moving along the flowlines of the negative gradient can only decrease $f$, this means that the minimum is attained at $x:= \lim\limits_{t \rightarrow \infty} \phi_t(y)$, so then $x$ would be a critical value for $f|_{A_y}$. But even ignoring the fact that I don't know why $A_y$ is necessarily closed, I don't see why if $x$ is a critical value for $f|_{A_y}$, then it is a critical value for $f$ as well.
I am thinking that this attempt not enough, as it doesn't use at all the fact that $f$ is a Morse-Bott function. But I don't see how to use this fact. I also know that $\nabla_x^2 f (v) = \nabla_V \nabla f$ for $x \in Crit(f)$ and $v \in T_xM$ and $V$ a vector field extending $v$, where $\nabla_V (\cdot)$ in the RHS is the Levi-Civita connexion of $g$, but I can't see how to use this either.