Problem:

Consider a m by m grid of dots at positions {(i,j) : 1<= i <= m, 1<=j <= m} in the plane. Each dot is colored black or white. How large must m be such that for every way to color the dots, there is a rectangle whose four corners all have the same color?

I know that there is an answer for the upper bound and lower bound but I'm confused. Could anyone please suggest a way to do this problem. Thank you.