Solution (source code)

= Solution

This is always true. Pull the given coloring of $\mathbb N^2$ back along the dilation
$$
(x,y)\longmapsto(2x,2y).
$$
Apply the <Gallai theorem for an integer lattice> to the four vertices of the unit square. The image of the resulting homothetic square has side length $2q$, which is even, and all four vertices have one color.