Find the Fourier coefficients of $g$ Suppose $f:\mathbb{R}\rightarrow\mathbb{R}$ is periodic with period $2\pi$ so that $\hat{f}(n)=\frac{1}{1+n^{2}}$ for every $n\in \mathbb{N}$, and $g:\mathbb{R}\rightarrow\mathbb{R}$ is periodic with period $2\pi$ and defined by the formula $g(x)=\int_{0}^{x}f(t)dt $ for every $-\pi\lneq x\leq \pi$.
How can I find $\hat{g}(n)$?
I've tried to go by the definition of the Fourier coefficient but didn't see a way to solve this.

Since you consider $\hat g (n) $, I'll assume that it's $\mathbb Z$ instead of $\mathbb N$ and that you are using the exponential. 
If $f$ is good enough (continuous, for instance; we need this to be able to exchange the integrals), you can write
\begin{align}
\hat g(n)&=\frac1{2\pi}\,\int_0^{2\pi} g(x)\,e^{inx}\,dx
=\frac1{2\pi}\,\int_0^{2\pi} \int_0^x f(t)\,dt\,\,e^{inx}\,dx\\ \ \\
&=\frac1{2\pi}\,\int_0^{2\pi} f(t)\int_t^{2\pi} \,e^{inx}\,dx\,dt\\ \ \\
&=-\frac1{2n\pi}\,\int_0^{2\pi} f(t)\, (1-e^{int})\,dt\\ \ \\
&=-\frac1{2n\pi}\,\int_0^{2\pi} f(t)\, dt-\frac1{2n\pi}\,\int_0^{2\pi} f(t)\,e^{int} dt\\ \ \\
&=\frac1{2n\pi}-\frac1n\,\frac1{1+n^2}
\end{align}
