It is most likely an ingrown or irritation from shaving.
Sounds like an ingrown hair to me, that is not serious at all.
Hi first thing is it is probably not cancer. i get the same thing and it is just a small syst. I pop mine with a needle that is sterilized clean the area really well first and after wards keep it clean. mine comes and goes about 4or5 times a year they get very annoying at times due to mine actually hurt if this is not the case with you i would talk to your doc it might be something else.
Misty