If I understand your new question correctly (after the addition in your question and some clarification in the comments) you want to know, whether the following is true:
Let $f$ be a midpoint convex (a.k.a. Jensen convex) function on $[x_0,y_0]$, i.e. for any $x,y\in[x_0,y_0]$ $ f\left(\frac{x+y}2\right)\le \frac{f(x)+f(y)}2 \qquad (1)$ holds. Suppose that, moreover, $ f\left(\frac{x_0+y_0}2\right)=\frac{f(x_0)+f(y_0)}2 \qquad (2).$ Then $f(qx_0+(1-q)y_0)=qf(x_0)+(1-q)f(y_0)$ for $q=\frac{k}{2^n}$, where $n \in \mathbb{N}$, $k=0,1,...,2^n$.
This can be shown by induction on $n$.
For $n=1$ the claim is equivalent to (1).
For $n=2$ we want to show that $f\left(\frac{x_0+3y_0}4\right)=\frac{f(x_0)+3f(y_0)}4$ and $f\left(\frac{3x_0+y_0}4\right)=\frac{3f(x_0)+f(y_0)}4$. Using (1) for the points $\frac{x_0+3y_0}4$ and $\frac{3x_0+y_0}4$ we get $2f\left(\frac{x_0+y_0}2\right) \le f\left(\frac{x_0+3y_0}4\right) + f\left(\frac{3x_0+y_0}4\right). \qquad (3)$ We also get from (1) that $2f\left(\frac{x_0+3y_0}4\right) \le f\left(\frac{x_0+y_0}2\right) + f(y_0) \qquad (4)$ and $2f\left(\frac{3x_0+y_0}4\right) \le f(x_0)+f\left(\frac{x_0+y_0}2\right) \qquad (5) $ Combining (3), (4), (5) we get that $4f\left(\frac{x_0+y_0}2\right) \le 2f\left(\frac{x_0+3y_0}4\right) + 2f\left(\frac{3x_0+y_0}4\right) \le f(x_0)+2f\left(\frac{x_0+y_0}2\right)+f(y_0).$ But since from (2) we know that in fact the equality holds for the leftmost and rightmost expression, we get that equality holds in (4) and (5), too. This implies our claim for $n=2$.
Suppose that the claim is true for $n$, we will show it for $n+1$: Let $q=\frac{k}{2^{n+1}}$. If $k$ is even, the claim follows from induction hypothesis. If $k$ is odd, we can use what we proved in the case $n=2$, using either $\frac{k-1}{2^{n+1}}$ and $\frac{k+3}{2^{n+1}}$ or $\frac{k-3}{2^{n+1}}$ and $\frac{k+1}{2^{n+1}}$ instead of $x_0$ and $y_0$. (We can choose whichever pair belongs to the original interval. For these point the claim is true, since $k\pm1$, $k\pm 3$ are even.)
The proof is basically a modification of the proof that every midpoint convex function is rationally convex, see this question: Midpoint-Convex and Continuous Implies Convex (You can try whether other proofs mentioned there can be modified to you situation too.)