Does there exist a continuous function in the following fashion? Does there exist a continuous function $f:[0,1]\rightarrow[0,\infty)$ such that $$\int_0^1 \! x^{n}f(x) \, \mathrm{d}x=1$$ for all $n\geq1$?
 A: First answer: Hint: Suppose there is such an $f.$ Let $M= \max_{x\in[0,1]} f(x).$ Then
$$1 = \int_0^1x^nf(x)\,dx \le M\int_0^1x^n\, dx$$
for all $n.$

Second answer (better result): Suppose $f$ is continuous and nonnegative on $[0,1]$, and $\int_0^1 f(x)x\, dx = \int_0^1 f(x)x^2\, dx.$ Then
$$\tag 1 \int_0^1f(x)(x-x^2)\,dx = 0.$$
Now the integrand in $(1)$ is continuous and nonnegative. Thus the only way this integral can be $0$ is if the integrand vanishes identically. Since $x-x^2 > 0$ on $(0,1),$ we conclude $f = 0$ on $(0,1).$ By continuity, we must have $f = 0$ on $[0,1].$ This implies the answer to the original question is no.
A: No such $f$ exists.
I assume you mean for integer $n$.
This is almost the Hausdorff moment problem, with two variations:


*

*You have not specified $m_0$

*You require the measure be given by a continuous density function


The solution to the moment problem is unique, if it exists. The criterion at the wikipedia link implies that a solution exists iff $m_0 \geq 1$.
As pointed out in the comments, we can solve the problem by inspection. In terms of the dirac delta measure, it is
$$ \int_{[0,1]} x^n ((m_0 - 1) \delta(x) + \delta(x-1)) \, \mathrm{d} x = 1 \qquad \qquad (n \geq 1)$$
Alas, the dirac delta measure cannot be given by a continuous density function, so the function you seek does not exist.
A: How about $f(x) = \sum_{n = 0}^\infty a_n x^n$, where $a_n = \frac{n + 2}{2^{n + 1}}$? Partial sums $S_N(x) = \sum_{n = 0}^N a_nx^n$ are pointwise increasing and bounded above by $S_{\infty}(1)< \infty$ so $S_N(x)$ converges pointwise on $[0,1]$ and the bounded convergence theorem gives 
\begin{eqnarray*}
\int_0^1xf(x)\; dx
& = & 
\int_0^1\sum_{n = 0}^\infty a_nx^{n + 1}\; dx
\\
& = & 
\sum_{n=0}^\infty a_n\int_0^1x^{n+1}\; dx
\\
& = & 
\sum_{n = 0}^\infty \frac{a_n}{n + 2}
\\
& = & 
\sum_{n = 0}^\infty \frac{1}{2^{n + 1}}
\\
& = & 
1. 
\end{eqnarray*}
A: Let me take a look at this question from the point of view of Probability Theory. 
We want $\int_0^1 \! x^{n}f(x) \, dx=1$ for any $n\geq 1$ and the function $f(x)$ is assumed to be nonnegative. Take $n=1$ and denote $xf(x)$ by $g(x)$:
$$\int_0^1 \! g(x) \, dx=1, \quad g(x)\geq 0 \text{ for any } x\in[0,1].$$
This two conditions means that $g(x)$ is a probability density function of some random variable $X$. 
$$\int_0^1 \! x^{n}f(x) \, dx=\int_0^1 \! x^{n-1}g(x) \, dx=\mathbb E\left[X^{n-1}\right]=1\!\forall n\geq 1.
$$
Then $$\text{Var}[X]=\mathbb E[X^2]-\left(E[X]\right)^2=1-1=0$$ and the distribution of $X$ should be degenerate. Together with $\mathbb E\left[X\right]=1$ this imply $\mathbb P(X=1)=1$. This is the unique distribution with the property that first two moments are equal to $1$. But this distribution is not absolutely continuous and the required continuou function $f(x)$ does not exist. 
