In convex optimization book the 2.3 problem is as follows
A set $C$ is midpoint convex if whenever two points $a, b$ are in $C$, the average or midpoint $(a + b)/2$ is in $C$. Obviously a convex set is midpoint convex. It can be proved that under mild conditions midpoint convexity implies convexity. As a simple case, prove that if $C$ is closed and midpoint convex, then $C$ is convex.
Is the following a valid answer for the above question?
Every point on the line can be seen as the average of two other points on that line. Therefore, if for every pair of points their average is in $C$ then we can say that $C$ is convex.
Please correct me where I am wrong in this answer. I will be very thankful to you.
Suppose $x, y \in C$ where $C$ is closed and midpoint convex.
Since $C$ is midpoint convex, all points which can be expressed as $x + \frac{m(y-x)}{2^n}=\left(1-\frac{m}{2^n}\right)x+\frac{m}{2^n}y$ where $m< 2^n, m,n \in \mathbb{Z}$ are in $C$.
Now our goal is to show that $(1-\lambda) x + \lambda y\in C$, if you can construct a sequence of $m$ and $n$ such that $\frac{m}{2^n} \to \lambda$, then we can use closeness to conclude that $(1-\lambda) x + \lambda y$ is in $C$.