Do moments define distributions? Do moments define distributions?

Suppose I have two random variables $X$ and $Y$. If I know $E\left[X^k\right] = E\left[Y^k\right]$ for every $k \in \mathbb N$, can I say that $X$ and $Y$ have the same distribution?
This question is known as (indeterminate) moment problem and has been first considered by Stieltjes and Hamburger. In general, the answer to your question is: No, distributions are not uniquely determined by their moments.

The standard counterexample is the following (see e.g. Rick Durrett, Probability: Theory and Examples): The lognormal distribution

$$p(x) := \frac{1}{x\sqrt{2\pi}} \exp \left(- \frac{(\log x)^2}{2} \right)$$

and the "perturbed" lognormal distribution

$$q(x) := p(x) (1+ \sin(2\pi \log(x))$$

have the same moments.

Much more interesting is the question under which additional assumptions the moments are determining. @StefanHansen already mentioned the existence of exponential moments, but obviously that's a strong condition. Some years ago Christian Berg showed that so-called Hankel matrices are strongly related to this problem; in fact one can show that the moment problem is determinante if and only if the smallest eigenvalue of the Hankel matrix converges to $0$. For a more detailed discussion see e.g. this introduction or Christian Berg's paper.
A moment is an integral of a weighted probability distribution, which is a number. So the mapping is "many-to-one" which is not invertible. So an integral cannot serve as the definition for an integrand.