When looking at a spectrum of light from a star, how can we tell that the light has undergone red shift (or blue shift)?
In order to tell whether a particular Object in Space is redshifted or blueshifted, you will have to compare it with a reference Spectrum, particularly the Spectrum from our Sun or Laboratory absorption wavelengths at particular wavelengths.
For Example, the typical hydrogen absorption wavelength occurs at about 656 nm, this is the Standard absorption wavelength. Now suppose you obtained a spectrum from a distant star and most probably that star will contain hydrogen.
If the Hydrogen absorption line in the spectrum of that star occurs at let's say 650 nm, this shows that the Star is blueshifted i.e. moving towards us. On the other hand if the absorption peak occurs at 660nm, this shows that the star is receding away from us or in other words the Star is redshifted.