Let $f\in L^2(\mathbb{R})$ be such that $\hat{f}$ is supported on $[-\pi,\pi]$. Show that $$\hat{f}(y)=1_{[-\pi,\pi]}(y)\sum_{n=-\infty}^\infty f(n)e^{-iny}$$ in the sense of $L^2(\mathbb{R})$-norm convergence.
I know that $f$ must be continuous and going to $0$ at $\pm\infty$. The Fourier transform on $L^2$ is defined in a rather complicated way as a limit of Fourier transforms of functions in the Schwartz class. The right-hand side is an infinite sum (rather than the integral). How can we relate the two sides?