I propose here an intuitive argument that may be didactic for beginners.
Let $C$ be midpoint convex and closed, and consider any two points $x,y\in C$.
The intuition
To prove convexity, we need to prove that any $z=\lambda x + (1-\lambda)y$ with $\lambda \in [0,1]$ is in $C$.
Look at the image below. We are going to prove that it exist a sequence of midpoints $z_1, z_2,\ldots, z_k$ that converges to such point $z$. This sequence is built by computing, recurrently, the midpoint. On each iteration, we need to choose the closest midpoint to $z$, thus, sometimes we will take the left part of the segment $X_{l}^{k}$ and other times the right part $X_{r}^{k}$, just to ensure we approach $z$.

Following the intuition from the image, we build the first midpoint as:
$z_1 = (x+y)\frac{1}{2}=\frac{1}{2}x+\frac{1}{2}y$
Now, as $z \in X_{r}^{1}$, we choose the right part of the segment to continue the iteration:
$z_2=(z_1+y)\frac{1}{2}=(\frac{1}{2}x+\frac{1}{2}y + y)\frac{1}{2}=\frac{3}{4}x+\frac{1}{4}y$
Lets stop here. Here we figure out that the sequence of midpoints takes the form:
$z_k = \lambda_k x + (1-\lambda_k)y$
From the above example: $\lambda_1=\frac{1}{2}$, $\lambda_2 = \frac{3}{4}$...
Given that intuition, the coefficients take the following form:
$$\lambda_k = c_12^{-1}+c_22^{-2}+\ldots+c_k2^{-k}$$
where $c_i={0,1}$ is a bool number that means right (1) or left (0) choices to approach $z$.
In our example, we choose right on the first step:
$\lambda_1=1\cdot2^{-1}$
And right in the second, so:
$\lambda_2=1\cdot2^{-1}+1\cdot2^{-2}=\frac{3}{4}$
The proof
Now that we have the intuition lets do the formal math. We need to prove 1) that such $\lambda_k$ is convergent to a number lower or equal to 1 and 2) that the generated point is in $C$.
1.)Convergence
The sequence $z_k = x\lambda_k + y(1-\lambda_k)$ is convergent to a point $z=\lambda x + (1-\lambda)y \in C$.
As $c_k={0,1}$, we have that:
$$0\le\lambda_k =\sum_{i=1}^{k}{c_i2^{-i}} \le \sum_{i=1}^{k}{2^{-i}} = \frac{1-\left(\frac{1}{2}\right)^k}{1-\frac{1}{2}}-1=2(1-2^{-k})-1 \le 1$$
Thus, the serie is majored by a convergent serie bounded to 1. Notice that $k=0$ corresponds to the trivial case where $z=x$ or $z=y$.
Lets say that $\lambda_k \rightarrow \lambda$ so that $z_k = \lambda_k x + (1-\lambda_k)y \rightarrow z = \lambda x + (1-\lambda)y$.
2.)Included
$C$ is a closed set, so it contains the limit of any sequence with elements in $C$. It ensures that the the point $z_k \rightarrow z \in C$.
QED :)
Extra Ball
We could interpret $\lambda_k=c_12^{-1}+c_22^{-2}+\ldots+c_k2^{-k}$ as the representation in base two (binary) of the decimal part of the real number $\lambda\in[0,1]$ as much exact as we want to, just by adding terms to the sum.