What happens to the resistance of a wire if it is heated up? We had a little discussion in the physics class. We were talking about resistance, and she said that when a wire is heated up, the resistance also increases; but I think that the resistance decreases because when something is heated up the electrons also gain energy, enabling them to move with lower resistance. So what is correct approach and solution to this problem?
 A: Either one can be true depending on the material. In metals, the electrons don't need any additional energy to move, so the main effect of temperature is to cause the atoms to vibrate more, which interferes with the motion of the electrons, increasing the resistance.
On the other hand, in a semiconductor, the electrons do need to gain some non-zero amount of energy before they can start moving at all. In this case, raising the temperature does decrease the resistance for the reason you state.
On wikipedia it says: 

Near room temperature, the resistivity of metals typically increases
  as temperature is increased, while the resistivity of semiconductors
  typically decreases as temperature is increased. The resistivity of
  insulators and electrolytes may increase or decrease depending on the
  system.

You can read more about these effects on wikipedia here and here. 
A: The problem with assuming that "hotter" free electrons in a metal convey more current is that their motion is random in direction and so they do not contribute to the electric current as there is no net drift of charge.
Their average velocity due to their thermal motion is zero.
The application of an electric field accelerates the free electrons and so they gain kinetic energy and now the free electrons have a net velocity along the conductor, hence this motion constitutes a movement of charges in a particular direction - an electric current.  
However the free electrons collide with the lattice ions and transfer energy to the lattice ions which now have a greater kinetic energy - the temperature goes up as there has been ohmic heating.
So the free electrons have an average velocity along the wire called the drift velocity.
The drift velocity is order of magnitude 1 mm/s whereas the speed of the free electrons due to their thermal motion is order of magnitude 100 km/s.
With more kinetic energy the lattice ions vibrate more and thus there is a greater probability of the drifting free electrons colliding with them - the resistance has increased.
For a metal as the temperature increases its resistance increases because of the lattice ions vibrating more at higher temperatures.
For a lot of semiconductors and insulators raising the temperature increases the number of charge carriers and so the resistance decreases with increased temperature
A: Note that in supra-conductors the temperature is usually very low, so low temperature  and apparent mobility restriction are not incompatible with low resistivity.
In fact more thermal agitation also means more vibrations so to sketch it in very simple words, these are counteracting the electric force that forces the electrons to behave and be in a certain state, but they don't want to. 
To come back to the question about resistvity of wires, the phenomenon of increasing of resistivity when heating has long been used as a natural current regulator. The intensity increase, so by Joule effect the wire is heating up, so resistivity increases, so intensity decrease and so on.
For instance lightbulbs have been used in such a way, as very cheap but efficient current regulators, because the filament reaches hight temperatures and the effect is notable.
