i had this happen to me 2 months ago and yes it could be because of shaving. i was told to throw away the razor the used the last time i shaved. Shaving could allow bactria to enter the skin more easily...and this could lead to boils like what i had. it started out looking exactly like yours and was very painful and swollen. I used a hot compress and it developed a white head. i went to the doctor and they drained it for me (lanced it) and the pain was gone almost instantly and was gone completely within a few days
Hi,
You may need to go to the doctor to have it lanced it if gets too big and too painful. I've had to have 2 lanced before and it was instant relief. I think it's a good idea to get to the doctor anyway, just in case it is something else. Good luck and let us know how it goes :)