Here's Theorem 3.8-1 in Introductory Functional Analysis With Applications by Erwine Kreyszig:
Every bounded linear functional $f$ on a Hilbert space $H$ can be represented in terms of the inner product, namely, $$f(x) = \langle x, z \rangle \ \mbox{ for all } \ x \in H,$$ where $z$ depends on $f$, is uniquely determined by $f$, and has norm $$\Vert z \Vert = \Vert f \Vert.$$
Now my question is, do we really need the space to be complete? What if $f$ is a bounded linear functional on an inner product space $X$ such that $X$ is not a Hilbert space? Do we still have the conclusion of the above theorem? If not, then what counter-example can be given?
Completeness is needed. To see this, for any inner product space $X$, let $\overline X$ be its completion. Then let $z \in \overline X \setminus X$ and define a bounded linear functional on $X$ by
$$f (x) = \langle x, z\rangle$$
for all $x\in X$.
This functional cannot be written as $f(x) = \langle x, y\rangle$ for some $y \in X$. Assume that it can be done, then
$$(*) \ \ \ \langle x, y\rangle = \langle x, z\rangle$$
for all $x \in X$. As inner product is continuous, $(*)$ holds for all $x\in \overline X$. This force $y=z$ and it is impossible by construction.
(Note that this is the only counterexample one can give, given Theorem 3.8.1)