The below problem is from an exam in real analysis. Thus, only such methods may be used.
Show that a bounded continuous function $f:[1,\infty)\mapsto x\in\mathbb{R}$ is identically equal to zero if and only if $$\int_1^\infty f(x)x^{-n}dx=0$$ for $n=8,9,10,\dots$.
This is my attempt. Is it correct?
The criterion if and only if means that there is an equivalence. Thus, both the implication $\Rightarrow$ and $\Leftarrow$ need to be shown. Start with $\Rightarrow$. Thus, assume that $f(x)$ is a bounded and continuous function on $[1,\infty)$ that is identically equal to zero. Thus, $f(x):=0$. Now, we shall prove that $$\int_1^\infty f(x)x^{-n}dx=0.$$ Okay. We have $$\int_1^\infty f(x)x^{-n}dx=\int_1^\infty 0\cdot x^{-n}dx=\int_1^\infty0dx=[c]_1^\infty=c-c=0$$ for some constant $c\in\mathbb{R}$. Here, it was used that $0\in\mathbb{R}$ is the absorbing element in $\mathbb{R}$. Not let's proceed to $\Leftarrow$. Hence, assume that $$\int_1^\infty f(x)x^{-n}dx=0.$$ Now, we shall prove that $f(x)=0$ on $[1,\infty)$ and that it's bounded and continuous. Assume towards a contradiction that $f(x)\neq0$. Namely, $f(x)>0$, for definitiveness. Thus, there exists an $\epsilon>0$ and $\delta>0$ such that $f(x_0)=L$ and $L-\epsilon<f(x)<L+\epsilon$ in $x\in[x_0+\delta,x_0-\delta]$ for some $x_0\in[1,\infty)$. Consequently \begin{align*} \int_1^\infty f(x)x^{-n}dx=\int_1^{x_0-\delta}f(x)x^{-n}dx+\int_{x_0-\delta}^{x_0+\delta}f(x)x^{-n}dx+\int_{x_0+\delta}^\infty f(x)x^{-n}dx>0 \end{align*} which contradicts that $$\int_1^\infty f(x)x^{-n}dx=0.$$ Thus, $f(x)=0$ on $[1,\infty)$. The zero function is trivially bounded and continuous.
Define $g(x)=x^{-8}f(x)$, so $g$ is bounded, continuous and integrable on $[1,\infty)$. Note that $$\int_1^\infty x^{-n}g(x)\,dx=0\quad(n\ge0).$$Now a suitable version of Stone-Weierstrass shows that $$\int_1^\infty g(x)\phi(x)\,dx=0$$for every $\phi\in C_0([1,\infty))$ (and hence for every $\phi\in C_c([1,\infty))$).