Based on your history and the limited image, it is not possible to confirm the diagnosis. It could be an inflamed hair follicle (folliculitis), an ingrown hair, a sebaceous cyst, or another skin lesion.
As it has been present for 2–3 months with intermittent pain and itching, I recommend an in-person examination by a General Surgeon or Dermatologist.
Next Steps
Avoid squeezing or scratching the swelling, keep the area clean and dry, and wear loose cotton clothing. If there is pus, increasing redness, fever, rapid increase in size, or severe pain, seek medical attention promptly, as it may require drainage and antibiotics.