Wifi standards selection algorithm for a wireless communication

How the endpoints select the Wifi standard?

Assuming a 802.11 access point supporting 2,4Ghz b/g/n and a client compatible with these three technologies, 2,4Ghz b/g/n.

How does the client select the standard for the communication?

Are there any standard upgrading/downgrading during a session regarding some conditions (deterioration, environments perturbations, etc.)?

Finally, on Linux or Windows host, is there a way to find out which standard is currently used by the NIC?