Let $K \subseteq \mathbb R^d$ be path-connected and compact and $f:K\to\mathbb R$ continuous. How can I show that there is a $\xi\in K$ such that $$\int_Kfd\lambda^d=f(\xi)\lambda^d(K)$$ where $\lambda^d$ denotes the Lebesgue-measure on $\mathbb R^d$.
Some ideas and hints would be appreciated, or maybe a hint on which theorems I should review.
Let $m = \inf \limits_{x \in K} f(x)$ and $M = \sup \limits_{x \in K} f(x)$. Now
$$m \, \lambda^d(K) \leq \int_K f \mathrm{d} \lambda^d \leq M\,\lambda^d(K).$$ Now, since $K$ is compact, there are $x_m, x_M \in K$ such that $f(x_m)=m$ and $f(x_M)=M$. Since $f$ is continuous and $K$ is connected, $f$ attains all values between $m$ and $M$. The claim follows.