Inverse Nasty Integral Intrigued by the original question on a nasty integral, one wonders what functions $f(x)$ exist such that 

$$\int_0^\infty f(x)\; dx=\frac {\pi}2$$

Something to do with the area of a half-circle with unit radius perhaps?
Edited To Add 
It should be specified that $f(x)$ should not contain $\pi$, and is preferably a rational function. 
The intention of posting the question was to take a different approach to the the original nasty integral by first considering the answer and then working backwards, sort of a heuristic approach.
This has yielded an excellent answer posted by @achillehui below, which also addresses the original nasty integral question in a very simple way. 

Using Glasser's Master theorem, it is very easy to cook up very nasty looking
integral which evaluates to $\frac{\pi}{2}$. 
For example, start from the integral
$$\int_{-\infty}^\infty \frac{1}{u^2+1} du = \pi\tag{*1}$$
If one replace the $u$ in integrand by $\displaystyle\;x - \frac{1}{x} - \frac{1}{x+1} - \frac{1}{x+2}$, one obtain
$$\int_{-\infty}^\infty \frac{1}{\left(x - \frac{1}{x} - \frac{1}{x+1} - \frac{1}{x+2}\right)^2 + 1} dx = \pi$$
Expand the integrand and extract the even part, you get something to challenge your friends:
$$\int_0^\infty 
\frac{
x^{14}-15x^{12}+82x^{10}-190x^8+184x^6-60x^4+16x^2
}{x^{16}-20x^{14}+156x^{12}-616x^{10}+1388x^8-1792x^6+1152x^4-224x^2+16
}\; dx = \frac{\pi}{2}$$
Notes
The statement about Glasser's Master theorem in above link is slightly off. The coefficient $|\alpha|$ in front of $x$ there need to be $1$. Otherwise, there will be an extra scaling factor on RHS of the identity. When in doubt, please consult the original paper by Glasser, 

Glasser, M. L. "A Remarkable Property of Definite Integrals." Math. Comput. 40, 561-563, 1983. 

and an online copy of that paper can be found here.
Update
About the nasty integral that trigger all this. 
If we replace the $u$ in integrand of $(*1)$ by $t - \frac{1}{t} - \frac{1}{t+1}$, change variable to $x = \frac{1}{t}$ on both intervals $[0,\infty)$ and $(-\infty, 0]$ and combine the result. We get
$$ \int_{-\infty}^\infty
\frac{1}{\left(\frac{1}{x}-x-\frac{x}{x+1}\right)^2+1} \frac{dx}{x^2}
= \int_{-\infty}^\infty \frac{1}{\left(t-\frac{1}{t}-\frac{1}{t+1}\right)^2+1} dt = \pi
$$
With help of a CAS, the integrand in leftmost integral can be expanded to
$$\frac{1}{\left(\left(\frac{1}{x}-x-\frac{x}{x+1}\right)^2+1\right)x^2} =
f(x) \stackrel{def}{=}
\frac{(x+1)^2}{x^6+4x^5+3x^4 - 4x^3 - 2x^2 + 2x + 1}$$
In terms of  $f$, we have
$$\int_{-\infty}^\infty f(x) dx = \pi \quad\implies\quad
\int_0^{\infty} \frac{f(x) + f(-x)}{2} dx = \frac{\pi}{2}\tag{*2}$$
With help of a CAS again, one find
$$\frac{f(x) + f(-x)}{2} = \frac{x^8-4x^6+9x^4-5x^2+1}{x^{12}-10x^{10}+37x^8-42x^6+26x^4-8x^2+1}$$
The rightmost integral of $(*2)$ is nothing but the nasty integral in the link.
