For the most part, when units "obsolete" it usually means that you can no longer build them, unless you lack the resources required to build up to date units. If you have horses but not iron, you'll still be able to build horse archers when you get guilds for example. If you have advanced flight and composites but no aluminium you will not be able to build advanced fighters but can still build fighters. If you have advanced flight but no oil you'll still be able to build cavalry as long as you have horses.
When buildings and resources obsolete: most of it has already been mentioned.
Stables: Obsolete with advanced flight. You can no longer build them but can still use the xp bonus should you build cavalry. Any bonus from completing the horse whispering quest dissapear.
Monuments: obsolete with astronomy, can no longer build monuments but existing monuments may still provide culture. Egyptian obelisk no longer allow for extra priests to be assigned.
Monastries: Obsolete with scientific method, no longer provides science bonus and can still build priests without organised religion. Will provide same culture. No longer gains bonus from religious wonders such as spiral minaret, University of Sangkore, Apostilic Palace, Cistine Chapel.
Walls: Obsoletes with rifling: This is a weird one, because they technically become obselete with Gunpowder, as they do not provide a defensive bonus against gunpowder based troops. Once you have rifling, those you have will still provide defensive bonuses against pre gunpowder troops though you won't be able to build anymore.
Dun: Obsoletes with rifling: If you play as the celts, they will provide their Geurrila bonus to muskets and Grenadiers so it may be worth delaying rifling until you have assembly line.
Castles: The weirdest: Obsoletes with economics, so you'll loose the extra trade route and boost to espionage (in bts), but still keep the culture. It won't provide defensive bonus against post-gunpowder troops. It would be better of castles didn't obsolete so quickly because they are potentially quite useful.
Wonders:
Apostilic palace: You'll loose the ability to hold elections as well as the manufacturing bonus to relgious buildings when the person who has this wonder develops Mass Media.
Spiral Minaret, University of Sangkore, Angkor Watt: Obsolete with computers: All bonus dissapears, but you should still retain GP production (BTS) and culture with all wonders.
Chichen Itza: Obsoletes with rifling but will provide its bonus against all troops until you resreach it.
Hagia Sophia: Obseletes with steam power.
Kremlin: Obsoletes with Fibre Optics.
Great library, Temple of Artemis, Parthenon: Obsoletes with Scientific method. You loose the free specialists but will still get GP points from the wonders itself on BTS.
Stonehenge and the Colosses: Obsoletes with Astronomy. I'm not sure whether or not the free monuments dissapear with it Stonehenge or not or whether or not the culture dissapears as well.
The Great Lighthouse: Expires with corporation.
Note: the person with the wonder has to have the tech for the wonder to become obsolete.