On constants attainable by the expression $\int_0^1xf(x)dx$ 
Question. Let $f:[0,1]\to[0,1]$ be an analytic, motonically increasing function such that $f(0)=0$ and $f(1)=1$. Let $K\in(0,1)$ be a constant such that $\int_0^1xf(x) \, dx=K$. For which $K$ does there exist such a function $f$, and for which $K$ is $f$ unique?

If we changed the expression $\int_0^1xf(x) \, dx$ to simply $\int_0^1f(x) \, dx$, is it easy to see that any $K\in(0,1)$ works and we certainly do not have any uniqueness. In the case $f(x)=x^\alpha$ for $\alpha\in\mathbb Z_{>0}$ we get $\int_0^1xf(x) \, dx=1/(\alpha+2)$, so at least rational numbers of this form are attainable. Intuitively, it feels like the condition $\int_0^1xf(x) \, dx=K$ is very weak, so there should for every attainable value of $K$ be many functions $f(x)$ attaining it, but I'm having lots of trouble showing this, or finding all attainable values for $K$. Any help is appreciated!
P.S. If it helps, this arose out of a physics problem where $f(x)$ models the height of a liquid at distance $x$ away from a reference point, and the condition $\int_0^1xf(x) \, dx=\text{constant}$ comes from volume conservation of the liquid. So the question of uniqueness of $f(x)$ answers whether or not the behaviour of the body of liquid is completely determined by the conditions listed above.
 A: Note that if $f$ and $g$ satisfy the given conditions, then so does any convex combination of $f$ and $g$. Thus the set of attainable values is a convex subset of the reals, i.e. an interval.
This means that if $S = \sup \int xf(x)$ and $I = \inf \int x f(x)$ both subject to the given conditions, then any value in $(I,S)$ can be attained.
Further, the infimum $I$ is clearly $0$, and a sequence approaching this infimum is $P_n := x^n$ for integer $n$. This also means that any value in $(I,S)$ can be attained non-uniquely as a convex combination of some function that gets a value close to $S$ and the various $x^n$ for sufficiently large $n$.
The question remains what $S$ is, and if it can be attained. I'll argue that $S = 1/2,$ and it cannot be attained. The latter claim is easy if $S = 1/2$: since $f$ is analytic, thus continous, and it is $0$ close to $0$, then $xf(x) < x/2$ for $x < \varepsilon$ for some small $\varepsilon > 0,$ giving $\int xf < \varepsilon/4 + (1-\varepsilon)/2 < 1/2.$
Next, we argue that $S = 1/2$. Note that $S \le 1/2$ trivially, since $f \le 1.$ 
@Dark Malthorp below points out a simple witness for $S \ge 1/2:$ consider $f_n := 1 - (1-x)^n.$ This is easily seen to satisfy the conditions required. Further, $$ \int x f_n(x) = \frac{1}{2} - \int_0^1 x(1-x)^n \ge \frac{1}{2} - \int_0^1 (1-x)^n = \frac{1}{2} - \frac{1}{n+1}. $$
A: EDIT: Turns out I made a careless mistake in my answer and didn't manage to prove the case of infinite solutions for $K\in(0,1/2)$, only $K\in(0,1/3)$. I'll leave my answer here for now, but feel free to reference or extend it to give a more complete solution.
There will be infinitely many $f$ for $K\in(0,1/2)$, while outside that range no such $f$ exists since $0=\int_0^10dx<\int_0^1 xf(x)dx<\int_0^1xdx=1/2$ (as pointed out by Ian in the comments)
To show the first statement, you can construct infinite families of solutions in many ways. Here's one that I got: given a $K\in(0,1/3)$, we can show that for all $n>1/K>3$, the infinite family of functions $f_n(x)=(1-a_n)x+a_nx^{n-2}$, where $a_n=\frac{1/3-K}{1/3-1/n}$, all satisfy the given conditions.
Clearly, $f_n(0)=0,f_n(1)=1$. If we perform the integral, we get
$$
\int_0^1(1-a_n)x^2+a_nx^{n-1}dx
=\frac13(1-a_n)+\frac{a_n}{n}=\frac{1}3\frac{K-1/n}{1/3-1/n}+\frac{1}n\frac{1/3-K}{1/3-1/n}\\=\frac{1}{1/3-1/n}\left(\frac13K-\frac1{3n}+\frac1{3n}-\frac1nK\right)=K
$$
and finally, using the inequalities $\frac13>K>\frac1n$, we have
$$
0\le a_n=\frac{1/3-K}{1/3-1/n}\le1
$$
and therefore for all $x\in[0,1]$
$$
f'_n(x)=(1-a_n)+a_n(n-2)x^{n-3}\ge0
$$
which implies $f_n$ is monotonically increasing over this interval.
A: Consider $f(x)=\exp\big(\frac{\alpha}{\log(1-x)}\big),$ $x\ne0,1.$
$$ \int_0^1xf(x)~dx=K$$ where $K=2K_1(2)-\sqrt{2}K_1(2\sqrt{2})$ for $\alpha=1.$ Here $K_1$ is the modified Bessel function of the second kind.
$$\lim_{\alpha\to0}\int_0^1xf(x)~dx=1/2.$$
A: Sorry for the delay - I had some unexpected issues to deal with when I got home.
My claim that it would be possible to get all $K \in (0,1/2)$ using only cubic polynomials turns out not to be true. The largest $K$ obtainable with cubics is $9/20$ for $f(x) = x^3 - 3x^2 + 3x$. While the minimum appears to be $\approx 0.162$ for $f(x) = x^3 +bx^2 + cx$ where $b = (\sqrt{76} - 16)/10$ and $c = b^2/3$ (though I haven't confirmed that it is definitely the lowest).
Letting $$f(x) = \dfrac {x^3 + bx^2 + cx}{1 + b + c}$$
gives integrals 
$$\int_0^1 xf(x)\,dx = \frac 1{1+b+c}\left(\frac 15 + \frac b4 + \frac c3\right) = \frac {12+15b + 20c}{60(1 + b + c)}$$
Setting $$ \frac {12+15b + 20c}{60(1 + b + c)} = K$$ gives curves in $(b,c)$ coordinates all corresponding to the same $K$, so there is no uniqueness here. The function $f$ will be increasing on $[0,1]$ for the shaded regions of $(b,c)$ space:

To find larger or smaller $K$, you need higher degree polynomials: $f(x) = x^n$ gives an integral of $1/(n+2)$, while $f(x) = 1 - (x-1)^{2n}$ gives an integral of $1/2 - 1/(2n+1)(2n+2)$
