Yes, there is an elementary closed form for this integral:
$$\int_0^\infty\frac{2-\cos x}{\left(1+x^4\right)\,\left(5-4\cos x\right)}dx=\frac{\pi}{2\,\sqrt2}\cdot\exp\left(\frac1{\sqrt2}\right)\cdot\frac{\sin\left(\frac1{\sqrt2}\right)-\cos\left(\frac1{\sqrt2}\right)+2\,\exp\left(\frac1{\sqrt2}\right)}{1-4\,\exp\left(\frac1{\sqrt2}\right)\cos\left(\frac1{\sqrt2}\right)+4\,\exp\left(\sqrt2\right)}\tag1$$
Proof:
Let us denote the integral in question as
$$\mathcal{I}=\int_0^\infty\frac{2-\cos x}{\left(x^4+1\right)\,\left(5-4\cos x\right)}dx\tag2$$
Note that the trigonometric part of the integrand is a periodic function and can be expanded to a Fourier series with particularly simple coefficients:
$$\frac{2-\cos x}{5-4\cos x}=\sum_{n=0}^\infty\frac{\cos(n\,x)}{2^{n+1}}\tag3$$
(this can be easily checked by expressing cosines via exponents of an imaginary argument).
Now we can integrate it term-wise:
$$\mathcal{I}=\sum_{n=0}^\infty\left(\frac1{2^{n+1}}\int_0^\infty\frac{\cos(n\,x)}{x^4+1}dx\right)=\sum_{n=0}^\infty\left(\frac1{2^{n+1}}\cdot\frac{\pi}{2\,\sqrt2}\cdot\exp\left(-\frac{n}{\sqrt2}\right)\cdot\left(\sin\left(\frac{n}{\sqrt2}\right)+\cos\left(\frac{n}{\sqrt2}\right)\right)\right)\tag4$$
(for the integral, see DLMF 1.14, vii, Table 1.14.2, $4^{th}$ row).
Trig functions in the last sum can again be expressed via exponents of an imaginary argument, and then the sum is easily evaluated. Converting exponents back to trig functions and getting rid of complex numbers, we get the final result $(1)$.
It depends on $f$. For example, for $f(x)=1$,
$$\lim_{T\to\infty}\frac{1}{T}\int_0^T f(s)ds=\lim_{T\to\infty}\frac{T}{T}=1$$
but for $f(x)=x$,
$$\lim_{T\to\infty}\frac{1}{T}\int_0^T f(s)ds=\lim_{T\to\infty}\frac{T^2}{2T}=\infty$$
Best Answer
Break it into two integrals, on $[0,1]$ and on $[1,\infty)$. $$\int_1^\infty\frac{dx}{1+x^n}<\int_1^\infty\frac{dx}{x^n}=\frac1{n-1}$$ so $$\int_1^\infty\frac{dx}{1+x^n}\to0.$$ Also $$1-\int_0^1\frac{dx}{1+x^n}=\int_0^1\frac{x^n}{1+x^n}\,dx <\int_0^1 x^n\,dx=\frac1{n+1}\to0$$ so $$\int_0^1\frac{dx}{1+x^n}\to1.$$