Necessity of completeness of the inner product space in Riesz representation theorem I wanted to find a counter example to show that the completeness of the inner product space is necessary in Riesz representation theorem. Please give an example of a bounded linear functional $T$ on an incomplete inner product space $X$ which do not have any inner product representation i.e. there does not exist any $z$ in $X$ s.t. $T(x)= \langle ,z\rangle$ for all $x$ in $X$.
 A: In fact, this can be done quite generally for any inner product space which is not complete.
If $X$ is an inner product space which is not complete, then there is a completion1 $\widehat X$ of $X$. I.e., $\widehat X$ is a Hilbert space such that $X$ is a dense subspace of $\widehat X$.
Since $X$ is not complete, we have $\widehat X\setminus X\ne\emptyset$. Now if we take any $y\in \widehat X\setminus X$, then we have a continuous linear functional on $X$ given by
$$T\colon x\mapsto \langle y,x \rangle.$$ 
We have simply restricted the functional corresponding to $y$.
But since $y$ is the only possible2 representation for this functional, we do not have representation of $T$ using an element of $X$.

1This is the usual notion of a completion of metric or normed space. But additionally we have to check that we also have an inner product on $\widehat X$ and which extends the given inner product on $X$.
2Assume that $\langle y,x\rangle = \langle z,x\rangle$ for each $x\in X$. This means that $\langle z-y,x\rangle=0$ for each $x\in X$. And since $X$ is dense, this implies $z-x=0$, i.e., $z=x$. 
A: Let $X$ be an inner product space and let $X'$ denote its continuous dual. Define $\Phi:X\to X'$ as $z\mapsto f_z$ where $f_z(x)=<x,z>$ for $x\in X$. Clearly $\Phi$ is an anti-linear isometry (we assume that the inner product is linear in the first variable). The Riesz theorem says that $\Phi$ is onto if $X$ is complete. You want to see if the converse is true, i.e. whether $\Phi$ is not onto whenever $X$ is not complete. One way to easily see this is by observing that the continuous dual of any normed linear space is always complete. Hence if $\Phi$ is onto, then it would become a bijective isometry of the underlying metric spaces, forcing $X$ to be complete. Formally, we can prove as follows.
If $X$ is not complete, then there exists a Cauchy sequence $(z_n)$ of (unit) vectors in $X$ which does not converge. Consider the corresponding sequence $(f_{z_n})$ in $X'$ which is also Cauchy, because $\Phi$ is anti-linear and isometry $(\Vert f_{z_n}-f_{z_m}\Vert=\Vert z_n-z_m\Vert)$. Thus $X'$ being complete, there exists $f\in X'$ such that $(f_{z_n})\to f$. We claim that there exists no $z\in X$ such that $f=f_z$. Assume, for arriving at a contradiction, that $f=f_z$ for some $z\in X$. As $\Vert z_n-z\Vert=\Vert f_{z_n}-f_z\Vert$ and the right hand side goes to $0$ as $n$ tends to infinity, we conclude that the sequence $(z_n)$ converges to $z$ which gives a contradiction to where we started.
For an explicit example, consider $f:X=c_{00}\subseteq\ell^2\to \mathbb{C}$ definded as $f(x)=\sum\frac{x_n}{n}$ where $x=(x_n)$.
A: Take $C[0,1]$ with the $L^2$ inner product.
Let $\phi(f) = \int_{1 \over 2}^1 f(t) dt$.
It is straightforward to see that $\phi$ is bounded by Cauchy-Schwarz.
To see that $\phi$ cannot be represented by an element of $C[0,1]$ we proceed by contradiction. Suppose $\phi(f) = \int_0^1 g(t) f(t) dt$.
Let $f_n$ be the continuous function whose graph is given by joining the points $(0,1), ({1\over 2}-{1 \over n}, 1),({1 \over 2}, 0), (1,0)$. Note that $0=\phi(g \cdot f_n) = \int_0^1 g^2(t) f_n(t) dt
\ge \int_0^{{1\over 2}-{1 \over n}} g^2(t) dt$ from which it follows
that $g(t) = 0 $ for $t \in [0,{1 \over 2}]$.
Now choose a sequence of positive continuous functions $f_n$ such that $f_n$ has support on $[{1 \over 2}, {1 \over 2}+ {1 \over n}]$ and $\int_0^1 f_n(t) dt  = 1$, then we have $\phi(f_n) = 1$ for all $n$, but continuity of $g$ gives $\lim_n \phi(f_n) = g({1 \over 2}) = 0$, a contradiction.
Addendum: Here is a marginally simpler ending to the above proof: Let $\bar{\phi}(f) = \int_0^{1 \over 2} f(t) dt$ and note that $\phi(f) + \bar{\phi}(f) = \int_0^1 f(t) dt$. Since $\int_0^1 f(t) = \langle 1, f \rangle$, if we have $\phi(f) = \int_0^1 g(t) f(t) dt $, then this gives $\bar{\phi}(f) = \int_0^1 (1-g(t)) f(t) dt$. As above, we see that we must have $g(t) = 1$ for $t \in [{1 \over 2},1]$,
which contradicts the continuity of $g$ at $t={1\over 2}$.
A: You can take $X\subset\ell^2(\mathbb N)$ given by
$$
X=\{x\in\ell^2(\mathbb N):\ \text{ only finitely many entries of $x$ are nonzero }\}
$$
and
$$
Tx=\sum_{n=1}^\infty\frac{x_n}n
$$
A: Let $X$ the space of trigonometric polynomials, which is a dense subspace of $L^2[0,2\pi]$, with respect to the inner product
$$
\langle f,g \rangle=\frac{1}{2\pi}\int_0^{2\pi} f(x)\,\overline{g(x)}\,dx.
$$ 
Let $h(x)=\sum_{n=1}^\infty\frac{1}{n^2}\sin nx$. Clearly, $h\in L^2[0,2\pi]$, but $h\notin X$, and define on $X$ the bounded linear functional
$$
\ell{f}=\frac{1}{2\pi}\int_0^{2\pi} f(x)\,\overline{h(x)}\,dx.
$$
This is not representable by a trigonometric polynomial!
