How is mass defined by special relativity?

I am eagerly interested in all kinds of areas of physics. As the question of mass has been around for a pretty long time, I am interested about what modern physics namely special relativity says about it. Also what does it have to do with $$E=mc^2$$?

The discussion with mass becomes complicated if we talk about many particles (because if the particles interact, their mass is no longer additive), so let us limit our considerations to just one particle.

For one particle we can often define two usefull quantities: energy ($$E$$) and (three) momentum ($$\mathbf{p}$$). These quantities are distinguished by the fact that

(1) $$E$$ is conserved, i.e. does not change in time, if the laws that govern the evolution of the particle do not change over time. For example, Coulomb's law works the same way today as tomorrow. As a result, energy of non-accelerating particles in electrostatic field is conserved

(2) $$\mathbf{p}$$ is a 3d vector that is conserved if the laws that govern evolution do not change at different points in space. For example empty space is empty the same way, with no priveledged points, everywhere. Hence, the momentum of a particle in free space will be conserved

Now, the trouble with the above two quantities is that they are not covariant. For example, a particle that is moving, has non-zero kinetic energy, whilst stationary particle has no kinetic energy. But the same particle could be observed by two observers moving relative to each other, and the two observers would see the particle moving with different velocity relative to them. They would therefore see the same particle having different kinetic energy! This is not very convenient, since we would like to describe the properties of the particle, not the observer. Similar arguments apply to momentum.

However, it turns out that if you combine energy and momentum like this $$E^2-p^2 c^2$$, where $$p^2=\mathbf{p}.\mathbf{p}$$, and $$c$$ is the speed of light, you get something that does not depend on observer. This invariant scalar quantity is what we call mass ($$m$$).

$$E^2-p^2 c^2=m^2 c^4$$ (1)

Now everyone's favourite $$E=m c^2$$ is what you get if momentum is zero (particle is not moving). I must say I really do not like mention of $$E=m c^2$$ because it is the most famous equation of Special Relativity - the theory that is all about covariance and invariance (appearing the same to all inertial observers), yet the equation itself ($$E=m c^2$$) is not invariant! Equation (1), however, is.

Special relativity doesn't define what mass really is. It does tell us that moving particles have some invariant quantity which is the same for all observers in all inertial reference frames which is what we call mass.

On the other hand special relativity does have many new things to tell us about how things with mass behave. For example it says that particles without mass always have to move at the speed of light while particles with mass always will have a velocity less than the speed of light. This gives a simple way of determining if something has mass: if you can take an object and put it to rest then the object has to have mass. One can further use special relativity to give an operational definition of how much mass an object has in terms of measuring the acceleration when applying a given force (though this is basically the same as one would define it in Newtonian mechanics).

Special relativity also tells us something new about mass in it's relationship between mass, velocity and energy. If you are willing to accept that all things have a property called energy then mass can also be defined in special relativity as the energy a particle has when it's at rest ($$E = mc^2$$). This relationship implies that it would be possible for a massive particle at rest to decay into energy in the form of radiation without violating the laws of relativity (and this does happen in nature and it's predicted by quantum field theory).