I've found the following sentence in a proof:
In the following, $V \subset H$ are two classical real Hilbert spaces and $(\cdot,\cdot)$ is the inner product in $H$
Since $V$ is dense in $H$ and $(u,v)=0 \quad \forall v \in V$, then $u=0$
My attempt:
By density, for every $u \in H$ there is a sequence of functions $\{ \phi_k \}_k \in V$ s.t. $\phi_k \rightarrow u$ w.r.t the inner product $(\cdot ,\cdot )$.
Then we have, by continuitu of the inner product: $$0=(u, \phi_k) \rightarrow (u,u)=||u||^2$$
which means that $||u||^2=0$, and hence since we are in an Hilbert space we have $u=0$.
Is that correct?
is correct what you did. Another way to conclude the same thing would be to use this result, which is a consequence of the Hanh-Banach Theorem, defining the functional $f(v)=(u,v)$ so that $f$ vanishes in $V$. By the result I quoted $f$ is identically null in $H$, in particular $f(u)=(u,u)=|u|^2=0$ which says that $u=0.$