[guided]We now prove the converse. The assumption is that every expectation function
\begin{align*}
f_\psi:\mathbb{R}\to\mathbb{R},\qquad t\mapsto (U(t)\psi,AU(t)\psi)_H
\end{align*}
is constant whenever $\psi\in D$. A constant differentiable function has derivative zero, so in particular $f_\psi'(0)=0$. The derivative formula from the first step gives
\begin{align*}
0=f_\psi'(0)=-i(\psi,[H_0,A]\psi)_H.
\end{align*}
Multiplying by $i$ yields
\begin{align*}
(\psi,[H_0,A]\psi)_H=0
\end{align*}
for every $\psi\in D$.
This is only a diagonal identity. To prove that the operator itself vanishes on $D$, we need all mixed pairings against arbitrary test vectors in $D$. Define
\begin{align*}
B:D\times D\to\mathbb{C},\qquad (\phi,\psi)\mapsto (\phi,[H_0,A]\psi)_H.
\end{align*}
This is linear in $\phi$ and conjugate-linear in $\psi$ because the Hilbert-space inner product is linear in the first argument and conjugate-linear in the second argument.
The diagonal identity says $B(\eta,\eta)=0$ for every $\eta\in D$. Since $D$ is a complex linear space, the vectors $\phi+i^k\psi$ also lie in $D$ for $k=0,1,2,3$. Applying the complex polarization identity to the sesquilinear form $B$ gives
\begin{align*}
B(\phi,\psi)=\frac{1}{4}\sum_{k=0}^{3}i^k B(\phi+i^k\psi,\phi+i^k\psi).
\end{align*}
Every term on the right is zero because each $\phi+i^k\psi$ lies in $D$ and the diagonal quadratic form vanishes on all of $D$. Hence
\begin{align*}
B(\phi,\psi)=0.
\end{align*}
By the definition of $B$, this means
\begin{align*}
(\phi,[H_0,A]\psi)_H=0
\end{align*}
for every $\phi,\psi\in D$.[/guided]