Consider \begin{cases} u_t(x,t)=\sqrt{-1} u_{xx}(x,t), \quad (x,t)\in[0,2\pi]\times[0,\infty)\\ u(x,0)=f(x),\quad x\in[0,2\pi] \end{cases} where $f(\cdot) \in C^\infty$ is periodic with period $2\pi$. The problem asks to use Fourier series to express the solution to the above IVP problem with periodic boundary conditions \begin{cases} u(0,t)=u(2\pi,t)\\ u_x(0,t)=u_x(2\pi,t)\qquad \forall t\geq0 \end{cases} and show that $$\int_0^{2\pi}|u(x,t)|^2\ dx=\int_0^{2\pi}|f(x)|^2\ dx, \quad\forall t \geq 0$$ and that $$\lim_{t \to 0+}\int_0^{2\pi}|u(x,t)-f(x)|^2\ dx=0$$
[Observation] It is easy to check that $$u(x,t):=\sum_{n \in \mathbb{Z}} e^{-\sqrt{-1}n^2 t} c_n e^{\sqrt{-1}nx}$$ where $c_n={1 \over {2\pi}}\int_0^{2\pi}f(x)e^{-\sqrt{-1}nx}\ dx$ converges absolutely since $f$ is smooth and its Fourier coefficients decay very quickly, and indeed gives one possible solution to the IVP problem. Now conclusion holds true for thus defined $u(x,t)$ simply by using Parseval's equality. If we can show this is the only possible form of solution, we can get the conclusion, and that's where the problem is.
Essentially the solution heat equation with initial condition can be uniquely determined in some functional space where both the heat function and its derivative can be controlled by at most exponentially growing function at space direction, and can be solved uniquely with appropriate boundary condition in real-valued version simply by applying energy estimate. But these methods do not work out in this situation anyway. I tried the possibility that with the periodic boundary conditions imposed on space, together with the given initial condition $f(x)$, the boundary conditions can be uniquely determined thus applying Cauchy-Kowalevski theorem, yet it does not work so well, so I am not sure how to do this. Any comment will be greatly appreciated!!
Parseval's theorem applies for the situation where an orthogonal expansion (like Fourier expansion in your case) is already there for you to use. In your situation, to prove $$\int_0^{2\pi}|u(x,t)|^2\ dx=\int_0^{2\pi}|f(x)|^2\ dx, \quad\text{for any }\; t \geq 0,\tag{$\star$}$$ A general method w/o any expansion like brom mentioned in his answers is more preferable. His answer got a minor typo, so here is a more detailed version: $$G'(t) = \int_0^{2\pi} u(x,t)\overline{u}_t(x,t) + u_t(x,t)\overline{u}(x,t) \, dx \\ = \int_0^{2\pi} u(x,t)\overline{iu_{xx}(x,t)} + iu_{xx}(x,t)\overline{u}(x,t) \, dx \\ = -i\int_0^{2\pi} u(x,t)\overline{u_{xx}(x,t)} \, dx+ i\int_0^{2\pi} u_{xx}(x,t)\overline{u(x,t)} \, dx \\ = i\int_0^{2\pi} u_x(x,t)\overline{u_{x}(x,t)} \, dx - \color{blue}{iu(x,t)\overline{u_{x}(x,t)} \,\Big|_{0}^{2\pi}} \\ -i \int_0^{2\pi} u_x(x,t)\overline{u_{x}(x,t)} \, dx + \color{blue}{iu_x(x,t)\overline{u(x,t)} \,\Big|_{0}^{2\pi}}. $$ Blue terms vanish because of the periodic Cauchy boundary condition.
Other than observation, this is a typical result from separation of variables: $$ u(x,t) = X(x)T(t)\implies X(x)T'(x) = i X''(t) T(t) \\ \implies -k X(x) = X''(x), \quad T'(t) = -ik T(t) \\ \implies X(x) = c_1 \cos(\sqrt{k}x) + c_2 \sin(\sqrt{k}x),\quad T(t) = c e^{-ikt}. $$ To meet the Cauchy periodic boundary condition, $k$ must be $n^2$ for $n\in \mathbb{Z}$, so the choices of $X$ should be in the set of: $$ \operatorname{span}\{\cos(nx),\sin(nx)\}_{n\in \mathbb{Z}} = \operatorname{span}\{e^{\pm i n x}\}_{n\in \mathbb{Z}} = \operatorname{span}\{e^{i n x}\}_{n\in \mathbb{Z}}, $$ and the expression can be rewritten into the formula you gave: $$u(x,t):=\sum_{n \in \mathbb{Z}} c_n e^{i nx}\color{red}{e^{-i n^2 t}}.$$ Noitce I got a minus sign in the temporal separated solution. Lastly $u(x,0) = X(x)T(0) = X(x) = f(x)$ will give you the Fourier coefficients $\{c_n\}$.
You are just one step away from obtaining this fact if you have $(\star)$, now let $$w = u_1 - u_2$$ where $u_1$ and $u_2$ solve the original equation while satisfying the same Cauchy boundary condition and the initial condition. $w$ will satisfy: \begin{cases} w_t(x,t)=i w_{xx}(x,t), &\text{for }\; (x,t)\in[0,2\pi]\times[0,\infty),\\ w(x,0)= 0, &\text{for }\; x\in[0,2\pi]. \end{cases} Then by $(\star)$, we have: $$\int_0^{2\pi}|w(x,t)|^2\ dx= 0, \quad\text{for any }\; t \geq 0. $$ Knowing that the Fourier expansion of $f$ is unique (i.e. $c_n$'s are uniquely determined), what does above equality tell you about the uniqueness of the solution?