The fourier coefficients of a function depend only on its class in $L^2([0,2\pi])$ so you can think of $f$ to be the series $\sum_{n\geq 0} \dfrac{e^{inx}}{1+n^2}$ since they differ only on the set (of null Lebesgue measure) $2\pi\mathbb Z$.
If you don't really know much about Lebesgue theory, you want to compute the fourier coefficients in terms of the integrals : $c_n(f)=\frac{1}{2\pi}\int_{0}^{2\pi} f(t)e^{-inx}dx$. However you should know that the integral of a function doen't change if you modify its values in a finite number of points.
So the two integrals, with $f$ or with the series, are exactly the same : $c_n(f)=c_n(x\mapsto \sum_{n\geq 0} \frac{e^{inx}}{1+n^2})$.