Another answer in real functions
$$\begin{aligned}
\int\frac{1}{x^{2n+1}+1}\mathop{\mathrm{d}x}&=\boxed{\frac{\ln\left(\left|x+1\right|\right)}{2n+1}\\
-\frac{1}{2n+1}\sum_{k=1}^{n}\left(\cos\left(\frac{2k-1}{2n+1}\pi\right)\ln\left(\left|x^{2}-2\cos\left(\frac{2k-1}{2n+1}\pi\right)x+1\right|\right)\\
+2\sin\left(\frac{2k-1}{2n+1}\pi\right)\tan^{-1}\left(\cot\left(\frac{2k-1}{2n+1}\pi\right)-\csc\left(\frac{2k-1}{2n+1}\right)x\right)\right)+C}
\end{aligned}$$
where $n\in\mathbb{N}$.
Steps:
Let
$$I=\int\frac{1}{x^{n}+1}\mathop{\mathrm{d}x}$$
Do partial fraction decomposition
$$\frac{1}{x^{n}+1}=\frac{A_{1}}{x-z_{1}}+\frac{A_{2}}{x-z_{2}}+\dots+\frac{A_{n}}{x-z_{n}}$$
where $z_{1},z_{2},\ldots,z_{n}$ are the $n$
complex roots of $x^{n}+1$.
To find the value of $A_{i}$, multiply both sides of the equation with $x-z_{i}$ and find the limit of both sides as $x$ approaches $z_{i}$.
Only $A_{i}$ remains on the right side. The limit of the left side is
$$\lim_{x\to z_{i}}\frac{x-z_{i}}{x^{n}+1}=\lim_{x\to z_{i}}\frac{\left(x-z_{i}\right)'}{\left(x^{n}+1\right)'}=\lim_{x\to z_{i}}\frac{1}{nx^{n-1}}=\frac{1}{n{z_{i}}^{n-1}}=-\frac{z_{i}}{n}$$
(Note that ${z_{i}}^n=-1$).
Becase $n$ is an odd number, the integral can be rewritten as
$$I=\int\frac{1}{x^{2n+1}+1}\mathop{\mathrm{d}x}$$
where $n\in\mathbb{N}$.
The $2n+1$ complex roots of $x^{2n+1}+1$ are $-1,z_{1},z_{2},\dots,z_{n},\overline{z_{1}},\overline{z_{2}},\dots,\overline{z_{n}}$, where
$$z_{k}=\mathrm{e}^{\mathrm{i}\frac{-\pi+2k\pi}{2n+1}}=\cos\left(\frac{2k-1}{2n+1}\pi\right)+\mathrm{i}\sin\left(\frac{2k-1}{2n+1}\pi\right)$$
where $k=1,2,\dots,n$.
So the decomposition can be rearranged as
$$\begin{aligned}
I&=\int\left(-\frac{-1}{2n+1}\cdot\frac{1}{x+1}+\sum_{k=1}^{n}\left(-\frac{z_{k}}{2n+1}\cdot\frac{1}{x-z_{k}}-\frac{\overline{z_{k}}}{2n+1}\cdot\frac{1}{x-\overline{z_{k}}}\right)\right)\mathop{\mathrm{d}x}\\
&=\int\left(\frac{1}{2n+1}\cdot\frac{1}{x+1}-\frac{1}{2n+1}\sum_{k=1}^{n}\left(\frac{z_{k}}{x-z_{k}}+\frac{\overline{z_{k}}}{x-\overline{z_{k}}}\right)\right)\mathop{\mathrm{d}x}\\
&=\frac{1}{2n+1}\int\frac{1}{x+1}\mathop{\mathrm{d}x}-\frac{1}{2n+1}\sum_{k=1}^{n}\int\left(\frac{z_{k}}{x-z_{k}}+\frac{\overline{z_{k}}}{x-\overline{z_{k}}}\right)\mathop{\mathrm{d}x}\\
&=\frac{1}{2n+1}I_{0}-\frac{1}{2n+1}\sum_{k=1}^{n}I_{k}
\end{aligned}$$
$I_{0}$ is easy
$$I_{0}=\int\frac{1}{x+1}\mathop{\mathrm{d}x}=\ln{\left|x+1\right|}+C$$
Then $I_{k}$
$$\begin{aligned}
I_{k}&=\int\left(\frac{z_{k}}{x-z_{k}}+\frac{\overline{z_{k}}}{x-\overline{z_{k}}}\right)\mathop{\mathrm{d}x}\\
&=\int\frac{\left(z_{k}+\overline{z_{k}}\right)x-2z_{k}\overline{z_{k}}}{x^2-\left(z_{k}+\overline{z_{k}}\right)x+z_{k}\overline{z_{k}}}\mathop{\mathrm{d}x}
\end{aligned}$$
Let $z_{k}=a_{k}+b_{k}\mathrm{i}$, then $\overline{z_{k}}=a_{k}-b_{k}\mathrm{i}$. Note that $z_{k}\overline{z_{k}}={a_{k}}^2+{b_{k}}^2=\left|z_{k}\right|^2=1$, so
$$\begin{aligned}
I_{k}&=\int\frac{2a_{k}x-{2a_{k}}^2-{2b_{k}}^2}{x^2-2a_{k}x+{a_{k}}^2+{b_{k}}^2}\mathop{\mathrm{d}x}\\
&=\int\left(a_{k}\cdot\frac{2x-2a_{k}}{x^2-2a_{k}x+1}+2b_{k}\cdot\frac{-b_{k}}{{a_{k}}^2-2a_{k}x+x^2+{b_{k}}^2}\right)\mathop{\mathrm{d}x}\\
&=a_{k}\int\frac{2x-2a_{k}}{x^2-2a_{k}x+1}\mathop{dx}+2b_{k}\int\frac{-\frac{1}{b_{k}}}{\frac{{a_{k}}^2}{{b_{k}}^2}-\frac{2a_{k}x}{{b_{k}}^2}+\frac{x^2}{{b_{k}}^2}+1}\mathop{\mathrm{d}x}\\
&=a_{k}\int\frac{\mathop{\mathrm{d}}\left(x^2-2a_{k}x+1\right)}{x^2-2a_{k}x+1}+2b_{k}\int\frac{\mathop{\mathrm{d}}\left(\frac{a_{k}-x}{b_{k}}\right)}{\left(\frac{a_{k}-x}{b_{k}}\right)^2+1}\\
&=a_{k}\ln(\left|x^2-2a_{k}x+1\right|)+2b_{k}\tan^{-1}\left(\frac{a_{k}-x}{b_{k}}\right)+C
\end{aligned}$$
Substitute $a_{k}=\cos\left(\frac{2k-1}{2n+1}\pi\right),b_{k}=\sin\left(\frac{2k-1}{2n+1}\pi\right)$ into $I_{k}$ and you can get the final result above.
This answer can be futher generalized to integrals like $\int\frac{x^m}{x^n\pm 1}\mathop{\mathrm{d}x}$. See my answer to this question.