Does there exist any continuous function $f:\mathbb{R}\to\mathbb{R}$, $f(x)/(1+x^2)\in L^1(\mathbb R)$, such that $f(0)=1$ and
$$\int\_{-\infty}^{\infty}\frac{f(x)}{\left(1+x^2\right)^p}dx=0$$ for every $1\leq p\leq 2$?



Function orthogonal to powers of $1/\left(1+x^2\right)$
I think no such function exists. Assuming $\displaystyle{f(x)\over 1+x^2}\in L^1(\mathbb{R})$ the integral $\displaystyle\int\_\mathbb{R}{f(x)\over (1+x^2)^p}dx$ is analytic wrto $p>1$: indeed, for any $p>1$ and $|t|<p-1$, expanding $(1+x^2)^{t}$ in powers of $t$ we have, by Tonelli's theorem (w.rto the product measure space $\mathbb{R}\times\mathbb{N}$)


$$\begin{align}\int\_\mathbb{R}\sum\_m \bigg|{f(x)\over (1+x^2)^p}\big( \log(1+x^2)\big)^m {t^m\over m!}\bigg|dx&=\\=\int\_\mathbb{R} {|f(x)|\over (1+x^2)^{p-|t|}}\,dx&\le\int\_\mathbb{R} {|f(x)|\over 1+x^2} \,dx<+\infty\end{align}$$
and then by Fubini's  

$$\int\_\mathbb{R}{f(x)\over (1+x^2)^{p+t}}dx=\sum\_m \bigg(\int\_\mathbb{R}{f(x)\over (1+x^2)^p}\big( \log(1+x^2)\big)^m\,dx\bigg) {(-t)^m\over m!}, $$
that is the power series expansion for the integral at $p$.


Therefore $\displaystyle\int\_\mathbb{R}{f(x)\over (1+x^2)^p}dx=0$ for all $p\ge1$. Next, to simplify a little we may replace $f$ with its even part, and assume equivalently that the integral on $\mathbb{R}\_+$ vanishes. Changing variable with $\displaystyle u={1\over 1+x^2}\in[0,1]$ we have
$$\int\_0^1f\Big(\sqrt{{1\over u}-1}\Big)(1-u)^{-3/2}u^{p-1/2}du=0,\qquad \text{ for all } p\ge 1$$
that is, the function $g(u):=f\Big(\sqrt{{1\over u}-1}\Big)(1-u)^{-3/2}u^{1/2}$ has $\int\_o^1g(u)u^pdu=0$ for all $p\in\mathbb{N}$, so it must be identically zero, and so must $f$. 


