Firstly, I don't think you know what GPS is or how it works in consumer electronics devices. In things like cellphones and satnavs, it works because those devices have a GPS receiver which picks up signals from the GPS satellites in orbit around the Earth. No consumer electronics devices have GPS transmitters - i.e. they do not communicate back up to the GPS satellites (you'd need huge signal power to be able to do that, and it's totally unnecessary to need to do so anyhow).
So the phone or satnav receives signals from the GPS satellites, and uses software to determine the device's position on the Earth's surface. It may then use that location data in other apps if it wants, including transmissions over the cellular network.
But the only transmission mechanisms that a phone has (and thus the only way in which any third party can know whether or not the device is on or off) is the cellular network (and, latterly, Wifi internet connectivity). So even a phone which is GPS-enabled (which Knox's and Sollecito's were not in 2007) can only make outbound communications via a cellphone network or a Wifi network.
So that's now sorted out hopefully. Now, on the specific question of "how the police knew the phones were switched off", there's a very simple (and rather obvious) answer to that. When a phone is switched on and connected to the cellular network, it "handshakes" occasionally with the network to let the network know it's there, it's switched on, it's connected to the network, and which base station it's connecting to. If a phone is either switched off or falls out of signal coverage, these handshakes cease, and the network then registers that the handset is no longer connected to it. In this way, for example, if someone makes an incoming call to a device which is either switched off or out of signal coverage (as Sollecito's father did on the night in question), the network will make a quick check to see whether the phone is on the network, and when it establishes for sure that the phone isn't on the network, it will do something like auto-divert the call to the user's voicemail, or give a message along the lines of "the phone you are calling is not connected" etc.
And the networks keep records of when phones were and were not connected to the network. So the networks were able to tell the police that Sollecito's and Knox's phones were not connected to the network on the night of the murder. Now, there's a slightly complicated iteration of this issue, in that if you switch off your phone while you're still in network coverage, the phone will in essence tell the network that you're turning it off, and that the network should assume that your phone is off until it hears the "I've turned on again" transmission from your phone. If on the other hand your phone disconnects from the network simply because it's dropped out of signal coverage (even though the handset is still switched on), then obviously no such "sign off" handshake will take place. So the networks should in certain instances be able to determine whether a phone became disconnected from the network on account of a) it being manually switched off (or the battery dying), or b) it accidentally falling out of signal coverage.