I'm not sure how to put fancy formulae here because I'm a fairly new user. So bear with me for a moment as we go through a formulae-less reasoning.
1) I have a function $f(x)$.
2) I want to integrate $f(x)$ for $x$ between $0$ and $\pi$.
3) $f(x)$ is a numerical function from $0$ to $\pi$.
4) I take the Discrete Fourier Transform of $f(x)$
5) I now have the coefficients of the fourier series for $f(x)$, which I shall dub $F(x)$.
Can I calculate a definite integral of $f(x)$ from $0$ to $\pi$ by integrating each term of $F(x)$ from $0$ to $\pi$?
If $f$ is $L$-periodic and absolutely continuous on $[0, L]$, then its Fourier series is uniformly convergent and you may integrate term-by-term. You may also use the Weierstrass $M$-test to show that a particular Fourier series converges uniformly. In general, you can integrate infinite series term-by-term if they are either monotone convergent or uniformly convergent. However, if you simply wish to approximate the integral of $f$ you could just replace the infinite Fourier series with the corresponding $N$-th partial sum and integrate term-by-term because $\int_a^b \sum_{n = 1}^N f_n(x) dx = \sum_{n = 1}^N \int _a^b f_n(x) dx$.