Example 4 In an $m \times m$ grid paper, how many small squares must be selected at least, so that among these small squares, there exist four small squares whose centers form the 4 vertices of a rectangle, with the sides of the rectangle parallel to the sides of the original square.
The required minimum value is $\left[\frac{m}{2}(1+\sqrt{4 m-3})-1\right]+1$. Suppose the maximum number of small squares that can be selected such that no four of these squares have their midpoints forming the four vertices of a rectangle (with sides parallel to the original square's sides) is $k$. Assume that the number of squares in the $i$-th row is $k_{i} (i=1,2, \cdots, m)$, then
$$\sum_{i=1}^{n} k_{i}=k .$$

Let the $k_{i}$ small squares in the $i$-th row be in the $j_{1}, j_{2}, \cdots, j_{k_{i}}$ columns, $1 \leqslant j_{1}<j_{2}<\cdots<j_{k_{i}} \leqslant m$. If the squares in the $j_{p}, j_{q}$ columns of the $r$-th row are already selected, then the squares in the $j_{p}, j_{q}$ columns of any other row $s (s \neq r)$ cannot be selected simultaneously, otherwise they would form the four vertices of a rectangle. Therefore, for each $i$, considering the combinations of every two of $j_{1}, j_{2}, \cdots, j_{k_{i}}$, we get $\mathrm{C}_{k_{i}}^{2}$ combinations. For $i=1,2, \cdots, m$, we get $\sum \mathrm{C}_{k_{i}}^{2}$ combinations, and none of these combinations are the same (i.e., no repetition), and these combinations are all combinations of two from $1,2, \cdots, m$, with a total number of $\mathrm{C}_{m}^{2}$. Therefore,

i.e., $\frac{1}{2} \sum_{i=1}^{m} k_{i}\left(k_{i}-1\right) \leqslant \frac{1}{2} m(m-1)$.
$$\sum_{i=1}^{m} \mathrm{C}_{k_{i}}^{2} \leqslant \mathrm{C}_{m}^{2}$$

From $\sum_{i=1}^{m} k_{i}=k$, we get $\sum_{i=1}^{m} k_{i}^{2} \leqslant m(m-1)+k$. By the Cauchy-Schwarz inequality, we have
$$\sum_{i=1}^{m} k_{i}^{2} \geqslant \frac{\left(\sum_{i=1}^{m} k_{i}\right)^{2}}{m}=\frac{k^{2}}{m}$$

Thus, $\frac{k^{2}}{m} \leqslant m(m-1)+k$, hence $k \leqslant \frac{m}{2}(1+\sqrt{4 m-3})$.
Therefore, at least $\left[\frac{m}{2}(1+\sqrt{4 m-3})-1\right]+1$ small squares need to be selected.