Hello,
It can be due to fungal infection(tinea capitis). Tinea capitis is contagious and can spread direct contact with someone who has the condition, or if you touch contaminated items such as combs, hats, clothing, or similar surfaces. I suggest you to get it evaluated from a dermatologist. Diagnosis is by clinical examination of the scalp as well as a skin lesion biopsy with microscopic examination. My sincere advice would be to get it examined from a dermatologist.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your dermatologist. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.