I am trying to generalise the following proof in n real dimemtions:
Given a convex function $f:\mathbb{R}^n\rightarrow \mathbb{R}$, and a convex set $X\subset \mathbb{R}^n$, we will assume that the function has a locally maximum value over $X$ at $\vec{z}$ for some point in the interior of $X$. This means $\exists \varepsilon>0$, such that $\forall \vec{x}\in B_X(\vec{z}, \varepsilon),\ f(\vec{z})\ge f(\vec{x})$. Where $B_X(\vec{z}, \varepsilon)$ is a ball in $X$ of radius $\varepsilon$ centred around $\vec{z}.$\ \ Now take any two points, which are not $\vec{z}$, in this ball, and call them $\vec{x_1},\ \vec{x_2}$. We know that $f(\vec{z})\ge \max\{f(\vec{x_1}),f(\vec{x_2})\}$, WOLG we pick $f(\vec{x_1})$ to be the larger. This implies $f(\vec{z})\ge (1-t)f(\vec{x_1})+tf(\vec{x_1})\ge(1-t)f(\vec{x_1})+tf(\vec{x_2})$, for $t\in[0,1]$.
However we cannot use this to disporve that $f$ is convex as $\vec{z}$ is not on the segment of $\vec{x_1}, \vec{x_2}$. Is there a way to use my argument with some modification of careful choosing of $\vec{x_1}, \vec{x_2}$, or is it better to prove this using calculus and show that a the function will continue to increase from a minimum point in the convex set?