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.