Find a continuous function $f$ such $\int_{a}^{a^2+1}f(x)dx=0\quad\forall a\in \Bbb R$ Find  example : exsits a nonzero continuous function $f:\Bbb R\to \Bbb R$ satisfying
$$\int_{a}^{a^2+1}f(x)dx=0\quad\forall a\in \Bbb R$$
the book answer this: $f(x)=x^2(x-1)(x-\frac{3}{5}),0\le x\le 1$,
$f(x)=-f(-x),-1\le x\le 0$. 
$$\int_{-1}^{1}f(x)dx=0$$
But
$$\int_{1/2}^{5/4}f(x)dx\neq 0,a=\dfrac{1}{2}$$

I think the answer you have is the seed of a full answer. You have a formula for $f$ on $[-1,1]$, but then you would need to use the defining relation to extend $f$ to larger and larger domains.
Take $$f(x)=\begin{cases}x^2(x-1)(x-\frac{3}{5})&0\le x\le 1
\end{cases}$$ where we know that with $a=0$, $$\int_0^1 x^2(x-1)(x-\frac{3}{5})=0$$
For $a\in(0,1]$, 
$$\begin{align}
\int_a^{1} x^2(x-1)\left(x-\frac{3}{5}\right)\,dx+\int_1^{a^2+1}f(x)\,dx&\equiv0\quad\text{(apply $\frac{d}{da}$ to both sides of this functional relation)} \\-a^2(a-1)\left(a-\frac{3}{5}\right)+f(a^2+1)\cdot2a&=0\\
f(a^2+1)&=\frac{a}{2}(a-1)\left(a-\frac{3}{5}\right)
\end{align}$$
So for $x\in(1,2]$, using $x=a^2+1$, you have $$f(x)=\frac{\sqrt{x-1}}{2}\left(\sqrt{x-1}-1\right)\left(\sqrt{x-1}-\frac{3}{5}\right)$$ and now you have a formula 
$$f(x)=\begin{cases}x^2(x-1)(x-\frac{3}{5})&0\le x\le 1\\
\frac{\sqrt{x-1}}{2}\left(\sqrt{x-1}-1\right)\left(\sqrt{x-1}-\frac{3}{5}\right)&1<x\leq2
\end{cases}$$ that extends the book's answer to a larger domain. You can continue like this, extending the domain to $(2,5]$, then to $(5,26]$, and so on. For instance, the next extension gives
$$f(x)=\begin{cases}x^2(x-1)(x-\frac{3}{5})&0\le x\le 1\\
\frac{\sqrt{x-1}}{2}\left(\sqrt{x-1}-1\right)\left(\sqrt{x-1}-\frac{3}{5}\right)&1<x\leq2\\
\frac{\sqrt{\sqrt{x-1}-1}}{4\sqrt{x-1}}\left(\sqrt{\sqrt{x-1}-1}-1\right)\left(\sqrt{\sqrt{x-1}-1}-\frac{3}{5}\right)&2<x\leq5
\end{cases}$$ 
Once you've formalized this, check that everything is in order with negative input as well.

This reconciles with your example:
$$\begin{align}
\int_{1/2}^{5/4}f(x)\,dx&=\int_{1/2}^{1}x^2(x-1)(x-\frac{3}{5})\,dx+\int_{1}^{5/4}\frac{\sqrt{x-1}}{2}\left(\sqrt{x-1}-1\right)\left(\sqrt{x-1}-\frac{3}{5}\right)\,dx\\
&=\left[\frac{x^3}{5} -\frac{2 x^4}{5} + \frac{x^5}{5}\right]_{1/2}^1+\left[\frac{1}{5}\left((x-1)^{5/2}-2(x-1)^2+(x-1)^{3/2}\right)\right]_{1}^{5/4}\\
&=-\frac{1}{160}+\frac{1}{160}\\
&=0
\end{align}$$
