If $T$ is a bounded operator on a hilbert space $H$ and $\langle Tx,x \rangle=0$ for all $x$ in $H$, then $T=0$.
I'm considering what we can conclude if $\langle Tx,x \rangle=0$ for all $x$ in some subspace $D$ of $H$. Am I right in thinking that it's not enough or indeed necessary for $D$ to be a hilbert space for us to conclude that $T$ is zero on $D$? What we need is that $D$ is a subspace and $D$ is $T$ invariant i.e. $T(D)$ is contained in $D$
Actually, $D$ being closed has nothing to do with it @AndresCaicedo. $<Tx,x>=0$ for all $x$ in $D$ implies $T=0$ on $D$ precisely when $D$ is a subspace of $H$ and $T(D)$ is contained in $D$. This can be seen easily if you proof by the polarization identity. Then at the end of the proof you get $<Tx,y>=0$ for all $x,y$ in $D$. Then you need to be able to set $y=Tx$ so you need $Tx$ in D. So the OP is pretty much correct.