Hello,
Welcome to ehealthforum.
Since there is history of shaving before appearance of these bumps, it could be related to it(due to infection caused by the razor blade).
Other possibility could be STD (sexually transmitted infection). Get an examination done by your healthcare provider/doctor along with a STD screening test to find out what has happened.
Based on the examination findings and test results appropriate treatment will be started for you.
Take care.