Problem Statement: We assume the following: $L^2[-\pi,\pi]$ is a real Hilbert space with the inner product
$$\langle f,g\rangle = \int_{-\pi}^\pi f(x)g(x)dx$$
and the set
$$\left\{\frac{1}{\sqrt{2\pi}},\frac{\sin{nx}}{\sqrt{\pi}},\frac{\cos{nx}}{\sqrt{\pi}} : n=1,2,3,\dotsc\right\}$$
is an orthogonal basis for $L^2[-\pi,\pi]$. Let $V$ be the vector space spaneed by the set
$$\left\{\frac{1}{\sqrt{2\pi}},\frac{\sin{x}}{\sqrt{\pi}},\frac{\cos{x}}{\sqrt{\pi}},\frac{\sin{2x}}{\sqrt{\pi}},\frac{\cos{2x}}{\sqrt{\pi}},\right\}$$
Find a function $g \in V$ such that $$ \int_{-\pi}^\pi xf(x) dx = \int_{-\pi}^\pi g(x)f(x)dx $$ for all $f \in V$, and show that $g$ is unique in $V$. Then, find all possible solutions $g \in L^2[-\pi,\pi]$ that satisfy the above condition.
My attempt: I have no idea what I'm doing with this one. I know that any $f\in V$ has a unique representation as a linear combination of elements of the basis given, so
$$f = \sum^5_{i=1}\langle f, e_i\rangle e_i$$
where $e_i$ is the $i$th element of the basis of $V$ given above.
Now, in Hilbert space language, we are trying to find $g \in V$ such that
$$\langle x,f\rangle = \langle g,f \rangle$$
for all $f\in V$.
But short of trying to write out a linear combination of the basis elements and evaluating the integrals directly, which I did try and it got messy, I'm unsure of where to go from here. A hint would be much appreciated.