Let $(X,\mathcal{F},\mathbf{P})$ be a probability space and $f \colon X \mapsto \mathbf{R}^n$ an integrable function. We assume that $f$ takes its values in a closed convex set $C$ of $\mathbf{R}^n$ and that 


$$\int\_X f \textrm{d}\mathbf{P} = x$$
is an extremal point of $C$. 


Does $f$ coincide with the constant function $x$ ? 



Extremal point and probability
Yes, $f=x$ almost everywhere wrt $P$. Consider the push-forward measure $\mu=f\_\*P$
(in probability, it is also called the distribution of $f$). It is defined as
$\mu(E)=P(f^{-1}(E))$. This $\mu$ is a probability measure on $C$. Your condition becomes
$$\int\_C d\mu=x,\quad (1)$$
and this implies that $\mu$ is an atom at $x$.


EDIT. This is a special case of a theorem of Bauer 
(see, for example Phelps, Lectures on Choquet's theorem,
Proposition 1.4). Let $X$ be a non-empty compact convex set
in a locally convex space, and $x\in X$. Then $x$ is 
an extreme point if and only if the point mass at $x$ is the unique measure for which (1)
holds. Of course, you did not say that $C$ is bounded, but the reduction to this case
is easy.


