Hello,
Two possibilities are there for your symptoms. First of all, stress or hormonal changes may lead to excess oil produced by the oil glands in your scalp. This causes the harmless bacteria that live in the scalp to proliferate and feed off the oil, which produces the odor.
Second possibility is of a fungal infection causing tinea capitis.It 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. Diagnosis is by clinical examination of the scalp as well as a skin lesion biopsy with microscopic examination.Anti-fungal medications, taken by mouth, are used to treat the infection.
It is important to keep the area clean. A medicated shampoo, such as one containing selenium sulfide like selsen may also help.
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 doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.
Is there flaking? Is it an oily flakiness?
Try Nizoral shampoo. Or try washing your hair and then rinsing with a vinegar rinse. Fill a clean sink (scrub it out with baking soda and rinse as this won't leave harmful chemicals) with water and add about 2 tbsp of white vinegar and rinse your hair in that. Then maybe one more clear water rinse and you're done. The vinegar smell will go away as your hair dries, and it will get rid of greasy buildup and leave hair shiny. This may be too drying for dry hair.