In general, impedance is Z = R +jX, where R is resistance and X is the reactance. When frequency is zero (DC) the reactance becomes zero and the impedance is equal to the resistance. However, when the frequency is other than zero, impedance is not the same as resistance alone.Thanks, John! I hadn't ever considered this, but it seems so obvious once it is said.
The reactance is produced by reactive components which means capacitors and inductors , so at AC, impedance takes into account both the opposition resistance creates and the opposition to the current that reactive components create. Since now, at AC, not only resistors oppose the current but also capacitors and inductors, we need a new term which takes into account all the factors that "impede" current flow, that factor is called impedance.
If you want a deeper understanding here is an explanation, I'll try to make it as simple as I can, for those of you who know better, bear with me if I'm not being 100% accurate, I'll make it as sweet as I can.
Resistance represents the energy losses into heat when current flows through a conductor or material. As electrons collide with the atoms of the material, energy is lost, the more collisions, the more resistance so current will find it harder to move from place to place. If the current is steady, such as DC, the magnetic and electric fields will also be steady and that is basically the end of it, so the only thing which opposes current flow is resistance. However, if the fields are changing, which is the case with AC, resistance will be present in the material and oppose the current, but as current flows through the conductor it also produces a changing magnetic field, this changing magnetic field will generate (induce) a new current in the conductor, this induced current will travel in the opposite direction of the conductor relative to the initial current (Lenz Law). You can think of it this way (and this is only a simplification for educational purposes): suppose you are looking at AC current flowing to the right of a conductor for a period of time, this current creates a changing magnetic field which in turn generates an induced current which flows to the left of the conductor, therefore, this induced current opposes and reduces the initial current flowing to the right. This opposition which is produced by the changing magnetic field, and which is different from the opposition produced by the the resistance of the material, is represented by inductive reactance.
I just mentioned the effects of a changing magnetic field, but there is also a changing electric field and capacitive reactance takes into account its effects. Something interesting is that inductive reactance has a positive sign, whilst capacitive reactance has a negative sign, meaning that they counteract each other, if inductive reactance is greater, the total circuit reactance X will be positive, if capacitive reactance is greater, the sign will be negative, if they are the same, reactance will be zero and only resistance opposes the current. Reactance also varies with frequency, as opposed to resistance which doesn't depend on frequency.
Now we have this scenario in which there are basically two things which oppose current: resistance (due to collisions) and reactance (due to changing magnetic and electric fields). So we can no longer talk about resistance alone, we need a new quantity which takes into account all those things I just mentioned, the quantity which takes them all into account is called impedance. So only when you are using DC (no changing fields) or when the inductance and capacitance of the circuit is negligible, the reactance is zero and you can say that impedance = resistance, otherwise, impedance is not equal to resistance.
I hope this makes sense