The midpoint of the line segment $ AB $ is :
$$ M = \left(3,~5\right) $$To find midpoint between points $ A(x_1,y_1) $ and $ B(x_2,y_2) $, we use formula:
$$ M = \left( \frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2} \right) $$In this example we have:
$$ \begin{aligned} & A \left(2,~3\right) \implies x_1 = 2 ~~\text{and}~~ y_1 = 3 \\[1 em] & B \left(4,~7\right) \implies x_2 = 4 ~~\text{and}~~ y_2 = 7 \end{aligned} $$After substituting into above formula, we get:
$$ \begin{aligned} M & \left( \frac{ 2 + 4 }{2}, \frac{ 3 + 7 }{2} \right) \\[1 em] M & \left( \frac{ 6 }{2}, \frac{ 10 }{2} \right) \\[1 em] M & \left(3,~5\right) \end{aligned} $$