[guided]We prove the identity pointwise, because both $H_p p$ and the zero function are smooth real-valued functions on $T^*X \setminus 0$. Fix a point $\rho \in T^*X \setminus 0$. Choose a coordinate chart $(U,\varphi)$ on $X$ containing the base point $\pi(\rho)$, where $\pi: T^*X \to X$ is the cotangent projection. This chart induces canonical coordinates $(x,\xi) = (x_1,\dots,x_n,\xi_1,\dots,\xi_n)$ on $T^*U$: the $x_i$ record the base point and the $\xi_i$ record the covector components in the dual coordinate basis.
In these canonical coordinates, the Hamilton vector field associated to the smooth real-valued function $p: T^*X \setminus 0 \to \mathbb{R}$ is
\begin{align*}
H_p = \sum_{j=1}^n \frac{\partial p}{\partial \xi_j}\frac{\partial}{\partial x_j} - \frac{\partial p}{\partial x_j}\frac{\partial}{\partial \xi_j}.
\end{align*}
This formula says that $H_p$ is a first-order differential operator acting on smooth functions. We now apply it to the same function $p$. At a point $(x,\xi) \in T^*U \cap (T^*X \setminus 0)$, this gives
\begin{align*}
(H_p p)(x,\xi)=\sum_{j=1}^n \left(\frac{\partial p}{\partial \xi_j}(x,\xi)\frac{\partial p}{\partial x_j}(x,\xi)-\frac{\partial p}{\partial x_j}(x,\xi)\frac{\partial p}{\partial \xi_j}(x,\xi)\right).
\end{align*}
The reason this expression vanishes is not an estimate or a limiting argument; it is exact cancellation. For each fixed $j$, the two quantities $\frac{\partial p}{\partial \xi_j}(x,\xi)$ and $\frac{\partial p}{\partial x_j}(x,\xi)$ are real numbers. Real multiplication is commutative, hence
\begin{align*}
\frac{\partial p}{\partial \xi_j}(x,\xi)\frac{\partial p}{\partial x_j}(x,\xi)=\frac{\partial p}{\partial x_j}(x,\xi)\frac{\partial p}{\partial \xi_j}(x,\xi).
\end{align*}
Subtracting equal quantities gives
\begin{align*}
\frac{\partial p}{\partial \xi_j}(x,\xi)\frac{\partial p}{\partial x_j}(x,\xi)-\frac{\partial p}{\partial x_j}(x,\xi)\frac{\partial p}{\partial \xi_j}(x,\xi)=0.
\end{align*}
Every summand is zero, so the whole finite sum is zero:
\begin{align*}
(H_p p)(x,\xi)=0.
\end{align*}
Because the original point $\rho$ was arbitrary and the computation is valid in a canonical coordinate neighbourhood of any point of $T^*X \setminus 0$, the identity holds globally:
\begin{align*}
H_p p=0.
\end{align*}[/guided]