Why can one assume in "infinite grid of resistors" that in the center there are diagonal nodes that have $-1$ and $+1$ currents?
As in the matrix $P$ in the following picture:
In comments you said you were asked to find the equivalent resistance between these nodes.
Imagine you had a physical resistor network and were asked to measure the equivalent resistance between two nodes of that network. One way to do that would be to apply a test current in one of those nodes and out the other, and measure the voltage developed between the nodes.
What your book is showing is mathematically modeling what would happen if that test were done on the infinite network of resistors.