It might be instructive just to walk through the entire process. So, to that end here we go.
First, we note on the closed contour $C$, we can parameterize the three connected contours $C_1$, $C_2$, and $C_3$ as follows:
On $C_1$, we are on the real axis and have $z=t$ and $dz=dt$, where $t$ starts at $0$ and ends at $R$.
On $C_2$, we are on a circular arc with $z=Re^{it}$ and $dz=iRe^{it}dt$, where $t$ starts at $0$ and ends at $2\pi/n$.
On $C_3$, we are on a straight line segment with $z=e^{i2\pi/n}\,t$ and $dz=e^{i2\pi/n}\,dt$, where $t$ starts at $R$ and ends at $0$.
Now that we have our parameterizations, let's proceed to evaluate the integral contributions to each. First, as $R\to \infty$ the contribution to the closed contour integral from the integration over the circular arc $C_2$ vanishes. To see this, we write
$$\begin{align}
\left|\int_0^{2\pi/n}\frac{1}{1+R^ne^{int}}iRe^{it}dt\right|&\le\int_0^{2\pi/n}\frac{1}{|1+R^ne^{int}|}Rdt\\\\
&\le\int_0^{2\pi/n}\frac{1}{R^n-1}Rdt\\\\
&= \frac{2\pi}{n}\frac{R}{R^n-1}\\\\
&\to 0
\end{align}$$
as $R\to \infty$, for integer $n>1$.
Having evaluated the integral over $C_2$ as zero, we must have that the sum of the contributions of integrations over $C_1$ and $C_3$ must equal $2\pi i$ times the residue of the function $\frac{1}{1+z^n}$ at the single enclosed pole at $z=e^{i\pi/n}$. Therefore, we have that
$$\begin{align}
\int_0^{\infty}\frac{1}{1+t^n}dt+\int_{\infty}^{0}\frac{1}{1+t^n}e^{i2\pi/n}dt&=(1-e^{i2\pi/n})\int_0^{\infty}\frac{1}{1+x^n}\,dx\\\\
&=2\pi i \text{Res}\left(\frac{1}{1+z^n},z=e^{i\pi/n}\right)
\end{align}$$
The residue from the single enclosed pole is given by
$$\begin{align}
\text{Res}\left(\frac{1}{1+z^n},z=e^{i\pi/n}\right)&=\lim_{z\to e^{i\pi/n}}\frac{(z-e^{i\pi/n})}{1+z^n}\\\\
&=\lim_{z\to e^{i\pi/n}}\frac{1}{nz^{n-1}}\\\\
&=\frac{1}{-ne^{-i\pi/n}}
\end{align}$$
Finally, putting it all together, we find that
$$\int_0^{\infty}\frac{1}{1+x^n}dx=\frac{-2\pi i}{ne^{-i\pi/n}}\frac{1}{1-e^{i2\pi/n}}=\frac{\pi/n}{\sin(\pi/n)}$$
as expected!
PS: If using comments like this is not the right way for me to reply, please let me know, I am relatively new to stack exchange maths.
– Ognik Aug 14 '15 at 21:54