Here is my attempt. The result is not right. Please help identify the issue(s).
$\displaystyle f(x)=\int\cfrac{1}{x^4+1}\>\mathrm{d}x$, let $x=\tan t$, we have $ \mathrm{d}x = \sec^2 t\>\mathrm{d}t,\> t=\tan^{-1} x\in\left(-\cfrac{\pi}{2},\cfrac{\pi}{2}\right)$ \begin{align} \displaystyle f(\tan t)&= \int\cfrac{\sec^2 t\> \mathrm{d}t}{1+\tan^4 t}=\int\cfrac{\cos^2 t\> \mathrm{d}t}{\cos^4 t+\sin^4 t}=\int\cfrac{\cfrac{1+\cos 2t}{2}\> \mathrm{d}t}{(\cos^2 t+\sin^2 t)^2-2\sin^2 t\cos^2 t} \notag\\ &=\int\cfrac{1+\cos 2t}{2-\sin^2 2t} \>\mathrm{d}t =\int\cfrac{\mathrm{d}t}{2-\sin^2 2t} + \cfrac 12\int\cfrac{\mathrm{d}\sin 2t}{2-\sin^2 2t} \notag\\ &=\int\cfrac{\sec^2 2t \>\mathrm{d}t}{2\sec^2 2t-\tan^2 2t} + \cfrac {\sqrt{2}}8\int\cfrac{1}{\sqrt{2}-\sin 2t} + \cfrac{1}{\sqrt{2}+\sin 2t}\>\mathrm{d}\sin 2t \notag\\ &=\cfrac 12\int\cfrac{\mathrm{d}\tan 2t}{2+\tan^2 2t} +\cfrac{\sqrt{2}}{8}\ln \cfrac{\sqrt{2}+\sin 2t}{\sqrt{2}-\sin 2t} \notag\\ &=\cfrac {\sqrt{2}}4 \tan^{-1} \cfrac{\tan 2t}{\sqrt{2}} +\cfrac{\sqrt{2}}{8}\ln \cfrac{\sqrt{2}+\sin 2t}{\sqrt{2}-\sin 2t} \notag \end{align}
As $\tan 2t=\cfrac{2\tan t}{1-\tan^2 t}=\cfrac{2x}{1-x^2}, \cfrac{\sqrt{2}+\sin 2t}{\sqrt{2}-\sin 2t}=\cfrac{\sqrt{2}\sec^2 t+\tan t}{\sqrt{2}\sec^2 t-\tan t}=\cfrac{\sqrt{2}(x^2+1)+x}{\sqrt{2}(x^2+1)-x},$
$f(x)=\cfrac {\sqrt{2}}4 \tan^{-1} \cfrac{\sqrt{2}x}{1+x^2} +\cfrac{\sqrt{2}}{8}\ln \cfrac{\sqrt{2}(x^2+1)+x}{\sqrt{2}(x^2+1)-x}+c$
If the above holds, $\displaystyle \int_0^{\infty} \cfrac{\mathrm{d} x}{1+x^4}$ would be $0$, which is impossible(Should be $\cfrac {\sqrt{2}\pi}{4}$).
First of all, you made a typo in the final answer — the correct answer must be $$f(x)=\frac{\sqrt{2}}{4}\tan^{-1}\frac{\sqrt{2}x}{1\color{red}{-}x^2}+\frac{\sqrt{2}}{8}\ln\frac{\sqrt{2}(x^2+1)+x}{\sqrt{2}(x^2+1)-x}+C.$$
The next issue is the introduction of $\sec(2t)$ and $\tan(2t)$ when you switched to $$\int\frac{\sec^2 2t\,\mathrm{d}t}{2\sec^2 2t-\tan^2 2t}$$ (as part of an expression). Both $\sec(2t)$ and $\tan(2t)$ are undefined at some points within the domain $\displaystyle t\in\left(-\frac{\pi}{2},\frac{\pi}{2}\right)$, viz. at $\displaystyle t=\pm\frac{\pi}{4}$. Therefore, the antiderivative you find in terms of $t$ is in fact a piecewise-defined function: $$f(x(t))=\begin{cases} \cfrac{\sqrt{2}}{4}\tan^{-1}\cfrac{\tan2t}{\sqrt{2}}+\cfrac{\sqrt{2}}{8}\ln\cfrac{\sqrt{2}+\sin 2t}{\sqrt{2}-\sin 2t}+C_1, \text{ if } t\in\left(-\cfrac{\pi}{2},-\cfrac{\pi}{4}\right); \\ \cfrac{\sqrt{2}}{4}\tan^{-1}\cfrac{\tan2t}{\sqrt{2}}+\cfrac{\sqrt{2}}{8}\ln\cfrac{\sqrt{2}+\sin 2t}{\sqrt{2}-\sin 2t}+C_2, \text{ if } t\in\left(-\cfrac{\pi}{4},\cfrac{\pi}{4}\right); \\ \cfrac{\sqrt{2}}{4}\tan^{-1}\cfrac{\tan2t}{\sqrt{2}}+\cfrac{\sqrt{2}}{8}\ln\cfrac{\sqrt{2}+\sin 2t}{\sqrt{2}-\sin 2t}+C_3, \text{ if } t\in\left(\cfrac{\pi}{4},\cfrac{\pi}{2}\right). \end{cases}$$
Switching back to $x$ still creates a piecewise-defined function: $$f(x)=\begin{cases} \cfrac{\sqrt{2}}{4}\tan^{-1}\cfrac{\sqrt{2}x}{1\color{red}{-}x^2}+\cfrac{\sqrt{2}}{8}\ln\cfrac{\sqrt{2}(x^2+1)+x}{\sqrt{2}(x^2+1)-x}+C_1, \text{ if } x\in(-\infty,-1); \\ \cfrac{\sqrt{2}}{4}\tan^{-1}\cfrac{\sqrt{2}x}{1\color{red}{-}x^2}+\cfrac{\sqrt{2}}{8}\ln\cfrac{\sqrt{2}(x^2+1)+x}{\sqrt{2}(x^2+1)-x}+C_2, \text{ if } x\in(-1,1); \\ \cfrac{\sqrt{2}}{4}\tan^{-1}\cfrac{\sqrt{2}x}{1\color{red}{-}x^2}+\cfrac{\sqrt{2}}{8}\ln\cfrac{\sqrt{2}(x^2+1)+x}{\sqrt{2}(x^2+1)-x}+C_3, \text{ if } x\in(1,+\infty). \end{cases}$$
At the points $x=\pm1$, these expressions are undefined, and so the corresponding integrals have to be treated as improper. In your case, the integral $\displaystyle \int_0^{+\infty}$ has to be split at the discontinuity at $x=1$: $$\int_0^{+\infty}\cdots\,\mathrm{d}x=\int_0^1\cdots\,\mathrm{d}x+\int_1^{+\infty}\cdots\,\mathrm{d}x,$$ and then, when evaluating the antiderivative that you found, you'll have to take the one-sided limits from the left and from the right at $x=1$, which are NOT equal to each other! And that's probably the source of your wrong answer.
More specifically: $$\lim_{x\to1^{-}}\frac{\sqrt{2}x}{1-x^2}=+\infty \implies \lim_{x\to1^{-}}\arctan\frac{\sqrt{2}x}{1-x^2}=\frac{\pi}{2},$$ while $$\lim_{x\to1^{+}}\frac{\sqrt{2}x}{1-x^2}=-\infty \implies \lim_{x\to1^{-}}\arctan\frac{\sqrt{2}x}{1-x^2}=-\frac{\pi}{2}.$$