If you root a phone can you still get the upgrades to to the O/S? If I root my Motorola Droid Razr M, can I still get O/S upgrades?
If so, will they just happen automatically? Or do I need to install them (and if so where might I find instructions for that) ?
Whether you still can update to "official versions" via ota-update or otherwise, depends on multiple things. Basically, the manufacturer might include a check whether the currently installed ROM is valid -- in this case, an update will fail as you changed the /system partition during rooting. If no such check takes place, an update might succeed -- but you may have lost root access (if the update replaced the /system partition; tools like OTA RootKeeper might prove helpful in those cases).

For further details, please see e.g.


How do I update the OS on my device?
How do I upgrade my rooted Nexus One using OTA updates?
Rooting and updating to Official Updates