Example of function such that its each derivative and itself vanishes at 0 but any polynomial multiple of that function doesnot vanishes at infinity

Let $f(x)=\frac 1 {x^{2}}$. Then the conditions are satisfied with $a=2, n=0$. If you insist on an example where $f$ is smooth on the whole line you could multiply this function by a smooth function $g(x)$ such that $g=0$ in $(-1,1)$ and $g(x)=1$ for $|x| >2$.


$f(x)=\frac{1}{x}$ , then $f^n(x)=\frac{(-1)^n}{x^{n+1}},$ clearly $\lim\limits_{|x|\rightarrow \infty}f^n(x)=0$ for each $n.$

Now for each $n$ chose $\alpha>n+1$ $\lim\limits_{|x|\rightarrow \infty}x^{\alpha}f^n(x)=\infty$