Why does temperature of a system not change during a phase change of the system if even the internal energy of the system increases? I can't understand why the temperature of a system doesn't change during a phase change of the system if even the internal energy of the system increases. The problem is that I have never really understood the concept of temperature. Is the 'average' energy of all the particles in a system? If not, what is it and why does it not increase when the internal energy increases during a phase change?
 A: Although previous answers are correct in connection with atomic, and classical systems, I would like to give a more general and complementary point of view, which may help in improving the conceptual understanding of what is behind the concept of temperature.
The really misleading concept one has to remove in order to understand why temperature does not change during a first order phase transition is the proportionality between internal energy and temperature, which is true for ideal gases but does not have universal validity, even far from phase transitions.
For classical systems which have kinetic energy, it is possible to show (as a theorem, it is the content of the so-called equipartition theorem) that the average kinetic energy is proportional to the temperature of the system. Therefore an explanation of the constancy of the temperature at a phase transition in terms of an increase of potential energy while kinetic energy remains the same is possible (see Bob D's and Kraig's answers).
However, there are two limitations of such a point of view:

*

*it holds only for classical systems, because, as soon quantum effects
enter into play, equipartition theorem is not valid anymore and there
is no proportionality between kinetic energy and temperature, thus
phase transitions at low temperatures would become ununderstandable.

*Even for classical systems, there are thermodynamic systems where the
kinetic energy does not play a direct role in the thermodynamic
description. A simple example is the case of magnetic phase
transitions.

Moreover, the explanation in terms of interplay between kinetic and potential energy does not really justify why temperature remains exactly constant and it does not happen that there is simply a different share between increase of kinetic and potential energy.
A more general point of view, which sheds some additional light on the concept of temperature is the following.
From a purely thermodynamic point of view, the temperature can be defined as the inverse of the slope of the entropy surface $S$ as a function of the internal energy $E$:
$$
T = \frac{1}{  \frac{\partial S}{\partial E}  }
$$
where all variables of $S$ different from energy have to be kept constant when taking the partial derivative.
On the other hand, the thermodynamic definition is consistent with the Boltzmann's statistical mechanic definition of entropy as proportional to the logarithm of the number of microscopic states available to the system at given energy:
$$
S(E) = k_B \log \Omega(E)
$$
These two ingredients help to understand, on a completely general base, why temperature remains constant at a first-order phase transition.
Such a transition is characterized by the physical phenomenon of phase coexistence. I.e., there is an interval of energies (say $[E_1,E_2]$)where the system cannot stays anymore in a homogenous one-phase state, but becomes inhomogeneous, with coexistence of macroscopic regions made of one phase at the lower energy $E_1$, and others mode of the second phase, at the upper energy $E_2$.
As a consequence of this fact, entropy in the whole interval $[E_1,E_2]$ is simply a linear combination of the boundary entropies:
$$
S(E)=S(E_1)+ \frac{E-E_1}{E_2-E_1} \left( S(E_2)-S(E_1) \right)
$$
Therefore, it is an immediate consequence of the thermostatistical definition of temperature as derivative of the entropy, to obtain the constance of $T$ all along the phase coexistence interval. The physical intuition one can build on top of this description, just adding the extensiveness of the entropy,  is that temperature remains constant because of the linear increase with the energy of the spatial region, in the coexisting system, filled by the phase at higher energy.
All that is not in contradiction, but as a complement to the explanation in terms of kinetic energy, valid for the classical systems where kinetic energy plays a role.
A: 
I can't understand why the temperature of a system doesn't change during a phase change of the system if even the internal energy of the
  system increases.

The short answer is that the internal energy increases without a temperature change because, during a phase change, there is an increase in the potential energy of the system (the change in internal energy associated with the increase in separation distance of the molecules in the system) and not a change in the average kinetic energy of the molecules of the system, which is associated with a change in temperature of the system. 
Since the total internal energy $U$ of a system is the sum of its microscopic kinetic and potential energies, or 
$$U=KE+PE$$
The internal energy can increase or decrease with an increase or decrease of potential energy without any change in the kinetic energy of the system (which would be indicated by a change in temperature). This is what happens during a phase change where the heat added or removed is called the latent heat, i.e., heat that does not change temperature but that increases or decreases the internal potential energy of the system.
Hope this helps.
A: To help answer this question, I will first start with an example that should help you to understand what is happening. 
Consider a positively charged ball and a negatively charged ball on a table stuck together; pretend the charges are locked into the balls, so they do not become neutral despite touching. What happens when you try to pull them apart? They resist! In order to pull them apart, you must input energy, and thus the internal energy of this system increases. This is easy to see, because now the balls have a potential energy, as they want to move back together. This is a similar explanation for why the internal energy can change while the temperature remains constant. 
During a phase change from a liquid to a gas, the molecules are being pulled apart, just as the charged balls above were pulled apart. A liquid does not form unless there are attractive forces to hold it together. In water, you have polar molecules, so the main attractive force is the H$^+-~$O$^-$ attraction force. In other materials, you might see Van der Waals forces dominating. Regardless of what the force is, there is some binding force that must be overcome in order to change the state of the material; thus the change in internal energy is attributed to the increase or decrease in potential energy that arises as a result of the phase change. 
Please note that while I used liquids as an example, this logic is applicable to all phase changes. 
