Step 1: Divide top and bottom by $x^2$.
\[ \int\frac{1+x^2}{1+x^4}\,dx=\int\frac{\frac{1}{x^2}+1}{\frac{1}{x^2}+x^2}\,dx \]
Step 2: Rewrite the denominator.
Note $x^2+\frac{1}{x^2}=\left(x-\frac{1}{x}\right)^2+2$. The numerator is $1+\frac{1}{x^2}$.
Step 3: Substitute.
Let $t=x-\frac{1}{x}$, so $dt=\left(1+\frac{1}{x^2}\right)dx$. The integral turns into $\int\frac{dt}{t^2+2}$.
Step 4: Integrate and match.
\[ \frac{1}{\sqrt2}\tan^{-1}\left(\frac{t}{\sqrt2}\right)+c \] So $f(x)=t=x-\frac{1}{x}$. \[ \boxed{f(x)=x-\frac{1}{x}} \]