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 question about measure-weighted barycenters
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.


