The following is an old exam question I'm stuck on:
Show that for every $f \in C(\mathbb{T})$ (where $\mathbb{T} = [-\pi, \pi]$) there is an initial condition $g \in C(\mathbb{T}$ for which there is a solution $u(x,t)$ to the heat equation on a ring with $u(x,0) = g(x)$ and $|u(x,1) - f(x)| < \epsilon$.
Using Fourier series, it can be shown that the solution is of the form $u(x,t) = \sum_{n\in\mathbb{Z}} g_n e^{-n^2 t} e^{inx}$. But if we want to meet the second condition for some $f$ of the form $f(x) = \sum_{n\in\mathbb{Z}} f_n e^{inx}$, then, we're left with $$|u(x,1) - f(x)| = \left| \sum_{n\in\mathbb{Z}} (f_n - g_n e^{-n^2})e^{inx} \right|.$$
Equating Fourier coefficients, this implies that $g_n = f_n e^{n^2}$, but the series defined by such $g_n$ isn't in $L^2$ or even convergent. What am I doing wrong? Any suggestions would be helpful.
Approximate $f(x)$ uniformly by a trigonometric polynomial $h(x)$. By Stone-Weierstrass this can be done. Then explicitly find a solution $u(x,t)$ such that $u(x,1) = h(x)$.