A question about measure-weighted barycenters This is a question taken (inferred) from Ex. 19, chap 3 in Rudin's Real and Complex Analysis book. 
Let $\mu$ be Legesgue's measure on $X=[0,1]$. Given a measurable $L^{\infty}$ function $f:X\to C$, we denote by $R_f$ the essential image of $f$ (that is, the set of complex numbers $z\in C$ such that $\mu(f^{-1}(D(z,\epsilon))>0$ for all $\epsilon>0$, with $D(z,\epsilon)$ being the disc of center $z$ and radius $\epsilon$). 
We also denote by $A_f$ the set of all numbers of the form $z_E=\mu(E)^{-1}\int_E f\,d\mu$ for some measurable subset $E\subset [0,1]$ with $\mu(E)>0$.
It can be shown (not too difficult) that $R_f$ is a closed compact set and that we always have the inclusions $R_f\subset \bar{A_f}=\operatorname{Conv}(R_f)$, where $\operatorname{Conv}(R_f)$ denotes the convex envelope of $R_f$. (This property holds, I think, more generally for any finite, diffuse measure on a locally compact space.)
The question is: is it true that for any $f\in L^{\infty}([0,1],\mu)$, the set $A_f$ is actually convex, and if so, how to prove it?
 A: Claim: For every $f \in L^1[0,1]$, the set $A_f$ is convex.
Proof: Let $\mu_1=\mu$ be Lebesgue measure on $[0,1]$ and consider the signed measures $\mu_2,\mu_3$ on $[0,1]$ defined using the real and imaginary parts of $f$ by $\mu_2(E)= \int_E {\mathrm Re} (f) \,d\mu$ and $\mu_3(E)= \int_E {\mathrm Im} (f) \,d\mu$. 
We are given Lebesgue measurable sets $D,E$ in $[0,1]$ and $a,b>0$ with $a+b=1$. We must show there is a measurable set $G$ with 
$$(*) \quad z_G=a \cdot z_D+b \cdot z_E \, .
$$
We may assume that $r:=\mu(D)/\mu(E) \le 1$. By the Lyapunov theorem on convexity of the range of nonatomic vector measures  (see references below; it applies to signed measures, see e.g. [4]) there is a measurable set $E_1$ in $[0,1]$ with
 $$(\mu_1,\mu_2,\mu_3)(E_1)=r \cdot (\mu_1,\mu_2,\mu_3)(E) +(1-r) \cdot(\mu_1,\mu_2,\mu_3)(\emptyset) \, , 
$$
 so $\mu(E_1)=\mu(D)$ and $z_{E_1}=z_E$. By another application of Lyapunov's theorem, there is a measurable set $G$ in $[0,1]$ with
$$ (\mu_1,\mu_2,\mu_3)(G)=a \cdot(\mu_1,\mu_2,\mu_3)(D)+b \cdot (\mu_1,\mu_2,\mu_3)(E_1) \,.
$$
Clearly $\mu(G)=\mu(D)=\mu(E_1)$ and $G$ satisfies (*).
References:
[1]  A. Liapounoff, Sur les fonctions-vecteurs compl6tement additives, Bull. Acad. Sci. URSS S6r. Math.
 [Izvestia Akad. Nauk SSSR] 4 (1940) 465-478.
[2]  J. Lindenstrauss, A short proof of Liapounoff's convexity theorem, J. Math. Mech. 15 (1966) 971-972
[3] https://en.wikipedia.org/wiki/Vector_measure#Lyapunov
[4] Artstein, Zvi. "Yet another proof of the Lyapunov convexity theorem." Proceedings of the American Mathematical Society 108, no. 1 (1990): 89-91. 
 https://www.ams.org/journals/proc/1990-108-01/S0002-9939-1990-0993737-0/S0002-9939-1990-0993737-0.pdf 
[5] Ross, David A. "An elementary proof of Lyapunov's theorem." The American Mathematical Monthly 112, no. 7 (2005): 651-653.
