I have seen this theory but I am wondering what is the name of this theorem?
If
$~~~~~~$ 1- $\mathbb D$ is a closed convex set and real
$~~~~~~$ 2- $f:\mathbb D \rightarrow\mathbb R$ is a convex function,
$~~~~~~$ 3- $f$ has a maximum over $\mathbb D$
Then
$~~~~~~$ The maximum of $f$ is at an extreme point of $\mathbb D$.
This is called the Maximum Principle for convex functions. (See the final sentence of the introduction.)
If a maximum occurred at an interior point, then any line segment passing through the point would have ends at lower value than the middle point where the maximum occurs, violating convexity.