Hi, apologies if these questions are trivial and/or stupid.
Throughout, let $f$ be a Lebesgue measurable function (or continuous if you wish, but this is probably no easier). (Questions with distributions etc. are possible also but I want to keep things simple here).
QUESTION 1 (surely must be known?) If $$ \int_0^\infty t^n |f(t)| dt < \infty, \quad \int_0^\infty t^n f(t) dt = 0, \qquad \forall \\, n=0,1,2,\ldots, $$ when must $f \equiv 0$ almost everywhere? EDIT: CLARIFICATION (since several people seemed to misinterpret my question): this is really about classes of functions, expressed in terms of a growth/decay rate function $\phi$, which give unique solutions to the moment problem. I am NOT asking how to solve the moment problem itself!
If possible, find necessary and sufficient conditions on functions $\phi \searrow 0$ with the property that $$ \int_R^\infty |f(t)| dt \leq \phi(R) \qquad \Rightarrow \qquad f \equiv 0. $$ So, $\phi(R) = \int_R^\infty \exp(-t^{1/4}) |\sin(t^{1/4})| dt$ is not enough (by Example 2 below); nor is $\phi(R) = \int_R^\infty |f(t)| dt$ with f given by "coudy" in his/her answer below.
But $\phi = \chi_{[0,b]}$ is enough (by Example 1 below); moreover $\phi(R) = \exp(-\delta R)$ would be enough for any fixed $\delta > 0$, by my discussion of Example 1 below, because the relevant Laplace transform $F = \mathcal{L}f$ is analytic on the half-plane $\{ \mathrm{Re}(z) > -\delta \}$. So we want to know about the gap between $\exp(-\delta R)$ and functions like that given by "coudy" below.
FURTHER CLARIFICATION: by analogy, maybe an example from PDEs will explain better (I'm not saying this is related to my problem; I'm saying that this is the same kind of result as what I want):
Definition A null temperature function is a continuous function $u = u(x,t) : \mathbb{R} \times [0, \infty) \to \mathbb{R}$ such that the heat equation is satisfied, i.e. $\frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2}$ in $\{ t>0 \}$, and $u(x, 0) = 0$ for all $x$.
Theorem There exists a null temperature function satisfying $|u(x,t)| \leq \exp(A/t)$ with $A>0$, such that $u(x,t) \not\equiv 0$ for all $t>0$.
Theorem Let $u$ be a null temperature function satisfying $|u(x,t)| \leq A \exp(B t^{-\delta})$, for some $A,B>0$ and $\delta<1$. Then $u \equiv 0$.
So here the "critical" growth rate for null temperature functions is roughly $\exp(A/t)$. I am looking for a similar thing with "null moment functions".
Note that this is a totally different problem to: given $v$, find some $u$ satisfying the heat equation such that $u(x,0)=v(x)$.
QUESTION 2 (probably much harder; maybe unknown?) If instead we have only $\int_0^R |f(t)| dt < \infty$ for each $R>0$, and $$ \lim_{R \to \infty} \int_0^R t^n f(t) dt = 0, \qquad n=0,1,2,\ldots $$ when must $f \equiv 0$ almost everywhere? (I have very little idea about this).
I think these questions are clearly very natural, interesting, and important, but Googling etc. didn't work well (I tried "vanishing moments" and other phrases, but there's just too much stuff out there). Standard known examples/methods follow.
Example 1: if $f$ is compactly supported on $[a,b]$, say, then $f \equiv 0$ a.e. because polynomials are dense in $C[a,b]$.
Example 2: by taking imaginary parts of $\int_0^\infty t^{4n+3} \exp(-(1+i)t) dt \in \mathbb{R}$, we get $$ \int_0^\infty t^{4n+3} e^{-t} \sin t \\, dt = 0, $$ and so by substituting $t = x^{1/4}$, $$ \int_0^\infty x^n \exp(-x^{1/4}) \sin(x^{1/4}) dx = 0, \qquad n=0,1,2,\ldots $$
Alternative method for Example 1: consider the Laplace transform $F(z) = \int_0^\infty e^{-zt} f(t) dt$. In Example 1, $F$ is an entire function such that $F^{(n)}(0) = 0$ for all $n$, so $F \equiv 0$ and thus $f \equiv 0$ a.e. as required.
So, any condition on $f$ forcing $F$ to be analytic on some disc with centre $0$ is enough; but can we do better?
In Example 2, $f \in L^1(0,\infty)$ and so $F$ is bounded and analytic on $\{ \mathrm{Re}(z) > 0 \}$, and continuous on the boundary, with $\lim_{z \to 0} F^{(n)}(z) = 0$ for all $n$. But this is still not enough to force $F \equiv 0$.