What are the important precautionary measures to take when a flight (either GA or airliners) is operating in extremely cold (e.g. -10°C or below) or extremely hot (e.g. 40°C or above) weather conditions?
Pre-heat the engine
When the engine is cold, the metals may come in contact to each other, which greatly increases engine wear. The best way to pre-heat is to use a hangar.
Oil viscosity is closely related to temperature. If the temperature is too low, oil becomes too thick. Thick oil cannot flow around the engine compartments freely. Thin oil, on the other hand, may have reduced lubricating effect. Thus, choosing the correct oil type is important. An oil with lower viscosity may be used in cold climate, and likewise oil with high viscosity in a hot climate.
Cabin heat can be useful for warming the cabin, however a leakage may lead to carbon monoxide poisoning. Carbon monoxide detectors can be useful in providing an early warning.
Ice built up can affect aerodynamic surfaces severely. In serious cases, they may cause the wings to lose enough lift and stall. Pitot tubes and engine sensors may also give false readings if their de-ice/anti-ice system is not activated.
The density of cold air is greater than normal. Engine damage may be induced by pushing full throttle, which causes the engine to produce more power than it is rated.
In hot air, the density is reduced. This reduces engine performance, resulting in longer takeoff and landing rolls. Aerodynamic performance is also reduced, resulting in a higher TAS (true airspeed) for the same IAS (indicated airspeed). These effects must be taken into consideration in determining whether runway length is sufficient.
If there is high terrain near an hot airport, it may be necessary to circle the airport to climb as the plane may not have sufficient climb performance.
In cold conditions, the taxiways and runways are often icy and slippery. Heavy braking should be avoided.
In addition to Kevin's excellent answer, there are a few additional factors I can think of.
In colder, denser air, lift is greater for the same aerofoil, angle of attack and airspeed and lower in warmer, less dense air.
In piston engined craft with normally aspirated carburettors, the temperature will affect the risk of carburettor icing which can be counter intuitive. At very low temperatures, icing is much less likely than at warmer temperatures since very cold air contains little or no moisture. In fact, in the UK, carburettor icing is a risk at some power settings throughout the year since there are few days cold enough to be carrying dry air and relative humidity is high for most of the time.
All of the craft I have seen which require carb heating to counter this have an inlet temperature gauge with a green section. The pilot applies heat to keep the gauge in the green which might mean removing heat as the temperature drops. Heat is only used when needed since it lowers the density of the inlet charge to the engine which reduces available power.
The difference in all of these factors became very apparent to me when learning to fly an R22 helicopter. On cold, winter days, it was a different machine, climbing like a rocket, greatly reduced throttle setting for a given attitude and speed and even more manoeuvrability than usual. I remember once almost being in auto-rotation just to descend, she just didn't want to return to earth. Conversely, on hot summer days with my instructor, we sometimes had to do a running take off and would need quite a lot of power in the descent to keep the rate in check.
In short, most aircraft perform better when it's cold and dry.