[proofplan]
Apply the Jacobi identity for the Poisson bracket to the triple $(f, g, H)$. The hypotheses $\{f, H\} = 0$ and $\{g, H\} = 0$ kill two of the three terms, leaving $\{H, \{f, g\}\} = 0$, which says $\{f, g\}$ is a first integral.
[/proofplan]
[step:Apply the Jacobi identity to $f$, $g$, and $H$]
The Jacobi identity for the Poisson bracket states that for any three smooth functions $f, g, H: M \to \mathbb{R}$,
\begin{align*}
\{f, \{g, H\}\} + \{g, \{H, f\}\} + \{H, \{f, g\}\} = 0.
\end{align*}
[/step]
[step:Use the first-integral hypotheses to eliminate two terms]
Since $f$ is a first integral, $\{f, H\} = 0$. By antisymmetry, $\{H, f\} = -\{f, H\} = 0$. Therefore the second term vanishes:
\begin{align*}
\{g, \{H, f\}\} = \{g, 0\} = 0.
\end{align*}
Since $g$ is a first integral, $\{g, H\} = 0$, so the first term also vanishes:
\begin{align*}
\{f, \{g, H\}\} = \{f, 0\} = 0.
\end{align*}
The Jacobi identity now reduces to
\begin{align*}
0 + 0 + \{H, \{f, g\}\} = 0,
\end{align*}
i.e., $\{H, \{f, g\}\} = 0$. By antisymmetry, $\{\{f, g\}, H\} = -\{H, \{f, g\}\} = 0$, confirming that $\{f, g\}$ is a first integral.
[/step]