Given $f:\mathbb{R}^n\rightarrow\mathbb{R}$ is convex, then we have $f(y)\geq f(z)+Df(z)\cdot(y-z)$ where we fix a point $z\in B(x,r/2)$ Integrate the above inequality directly with respect to $y$, why do we have the inequality below? $$f(z)\leq\frac{1}{|B(z,r/2)|}\int_{B(z,r/2)}f(y)dy$$
How do we deal with the term $Df(z)\cdot (y-z)$ upon integrating with respect to $y$?
To deal with the term $\int_{B(z, \frac{r}{2})} Df(z)\cdot(y - z) dy$, first we note that by by linearity of integration and a change of coordinate, we have $$\int_{B(z, \frac{r}{2})} Df(z)\cdot(y - z) dy = Df(z) \cdot \int_{B(z, \frac{r}{2})} (y - z) dz = Df(z) \cdot \int_{B(0, \frac{r}{2})}ydy.$$ Indeed, by direct calculation, $$\int Df(z)\cdot(y - z) dy = \int \partial_if(z)(y^i - z^i)dy = \partial_i f(z) \int (y^i - z^i)dy = Df(z) \cdot \int (y - z)dy.$$ Finally, as @gerw pointed out, $$\int_{B(z, \frac{r}{2})}ydy = |B(z, \frac{r}{2})|z,$$ it follows that $$Df(z) \cdot \int_{B(0, \frac{r}{2})}ydy = Df(z) \cdot 0 = 0$$ and the inequality follows. For a bit more hint for the equality above, note that the domain of the integral $\int_{B(0, \frac{r}{2})}y_idy$ is symmetric with respect to the line $\{y_i = 0\}$, so if we split the integral as $$\int_{B(0, \frac{r}{2})}y_idy = \int_{B(0, \frac{r}{2}) \cap \{y_i > 0 \}} y_idy + \int_{B(0, \frac{r}{2}) \cap \{y_i < 0\} }y_idy = \cdots$$