Proving continuity of the following function Let $X,Y$  be compact sets in $\mathbb{R}^n$ (with the usual topology) and  let $f:X\times Y \rightarrow \mathbb{R }$ be a continues function function 
moreover let $P(Y)$ be the space of all probabilities on $Y$ with the weak topology.
How can we show that the following function is continues?
$F:X\times P(Y) \rightarrow \mathbb{R} $ defined as $F(x,p)=E_p[f(x,y)]$?
 A: Wouldn't this follow from the fact that the expectation is a bounded (hence continuous) linear functional for probability measures on compact spaces?
A: $E_p[f(x,y)]-E_{p^*}[f(x^*,y)]=(E_p[f(x,y)]-E_{p^*}[f(x,y)])+(E_{p^*}[f(x,y)]-E_{p^*}[f(x^*,y)])$
As $p^*\rightarrow p$ weakly, the first term converges to $0$, since you take the expectation of a given bounded continuous function. The second term is less than $\sup_{y}|f(x,y)-f(x^*,y)|$, which, by the compactness and the continuity of $f$, also converges to $0$ as $x^*\rightarrow x.$
A: Suppose $x_n \to x$ and $p_n \Rightarrow p$, where the second denotes weak convergence.
To show:
$$\int_Y f(x_n, y) dp_n(y) \to \int_Y f(x, y) dp(y).$$
Since $X \times Y$ is compact, $f$ is uniformly continuous. So $\sup_{y \in Y}|f(x_n, y) - f(x, y)| \leq \epsilon$ may be assumed. 
Then we have (using that the total mass is one)
$$
\left|\int_Y f(x_n, y) dp_n(y) - \int_Y f(x, y) dp(y)\right| \leq \left|\int_Y f(x, y) dp_n(y) - \int_Y f(x, y) dp(y)\right| + \epsilon
.
$$
The first expression on the right goes to zero by weak convergence.
