Prove that if m≤n, one of the columns can always be colored red. Then, when excluding this column, we can continue the process until the number of columns is smaller than the number of rows, i.e. n−m+1 times. Suppose we cannot color a single column red such that no two rows still appear alike. Then, for every column there are at least two rows that differ by only one square in that column. Consider those two rows for every column. Now consider a graph with its vertices being the rows and its edges being the pairs of rows of interest. As this graph has at least as many edges as vertices, the graph contains a cycle. Consider an arbitrary row (i.e. vertex) x of the cycle. Then the row it is followed by differs from row x exactly by one square, assume this square is located at the column y. Every next row differs from the previous one in exactly one column. As all these columns differ from column y, all the other edges of this cycle correspond to passing from one row to another such that the square in column y remains the same. Therefore, the square in column y remains the same in all the rows after x and it has to remain the same at the last passage which takes us back to the row x. This, however, means that all squares in row x have to be of the same color as the square at the row after x, a contradiction.
In general, no more rows can be colored red. Assume that all the squares are colored black to start with, apart from the diagonal of an m×m-subsquareboard. If we color n−m+2 columns red, there are always at least 2 columns which lie in that subsquareboard. But this means that we will over-color the only two white squares in two rows and thus we end up with two equally colored rows.