[proofplan]
We prove the result by differentiating the energy function $H\circ\gamma$ along the integral curve. The integral-curve equation replaces $\dot{\gamma}(t)$ by $X_H(\gamma(t))$, and the defining identity for the Hamiltonian vector field converts this derivative into $\omega(X_H,X_H)$. Since every two-form is alternating, this expression vanishes at each time, so the derivative of $H\circ\gamma$ is identically zero.
[/proofplan]
[step:Differentiate the Hamiltonian along the integral curve]
Define the smooth function $E:I\to\mathbb{R}$ by
\begin{align*}
E(t)=H(\gamma(t)).
\end{align*}
For each $t\in I$, differentiating the composite $H\circ\gamma$ gives
\begin{align*}
E'(t)=dH_{\gamma(t)}(\dot{\gamma}(t)).
\end{align*}
Since $\gamma$ is an integral curve of $X_H$, we have $\dot{\gamma}(t)=X_H(\gamma(t))$. Therefore
\begin{align*}
E'(t)=dH_{\gamma(t)}(X_H(\gamma(t))).
\end{align*}
[guided]
We introduce the energy along the trajectory as the map $E:I\to\mathbb{R}$ defined by
\begin{align*}
E(t)=H(\gamma(t)).
\end{align*}
The goal is to show that this real-valued function is constant. Since $E$ is smooth, it is enough to compute its derivative at an arbitrary time $t\in I$.
Differentiating the composite map $H\circ\gamma$ gives
\begin{align*}
E'(t)=dH_{\gamma(t)}(\dot{\gamma}(t)).
\end{align*}
Here $dH_{\gamma(t)}:T_{\gamma(t)}M\to\mathbb{R}$ is the differential of $H$ at the point $\gamma(t)$, and $\dot{\gamma}(t)\in T_{\gamma(t)}M$ is the velocity vector of the curve at time $t$.
Now we use the defining property of an integral curve. The hypothesis says precisely that the velocity of $\gamma$ at time $t$ is the Hamiltonian vector field evaluated at the point $\gamma(t)$:
\begin{align*}
\dot{\gamma}(t)=X_H(\gamma(t)).
\end{align*}
Substituting this identity into the derivative formula gives
\begin{align*}
E'(t)=dH_{\gamma(t)}(X_H(\gamma(t))).
\end{align*}
This reduces conservation of $H$ to a pointwise algebraic identity involving the symplectic form.
[/guided]
[/step]
[step:Use alternation of the symplectic form to make the derivative vanish]
Fix $t\in I$ and set $p=\gamma(t)$. By the defining identity for $X_H$, applied at the point $p$ with the tangent vector $v=X_H(p)$, we obtain
\begin{align*}
dH_p(X_H(p))=\omega_p(X_H(p),X_H(p)).
\end{align*}
Because $\omega_p:T_pM\times T_pM\to\mathbb{R}$ is alternating, every vector pairs with itself to zero. Hence
\begin{align*}
\omega_p(X_H(p),X_H(p))=0.
\end{align*}
Combining this with the derivative formula from the previous step gives
\begin{align*}
E'(t)=0.
\end{align*}
Since $t\in I$ was arbitrary, $E'=0$ on $I$.
[/step]
[step:Conclude that the Hamiltonian is constant along the trajectory]
The function $E:I\to\mathbb{R}$ is smooth and satisfies $E'(t)=0$ for every $t\in I$. Therefore $E$ is constant on the interval $I$. Since $E=H\circ\gamma$, this means that $H(\gamma(t))$ is constant in $t$, as claimed.
[/step]