So sometimes in Anime and Manga when someone is acting crazy or out of character when on a rant they wear a headband with two flashlights or lit candles pointing up.
I am wondering what the reason for this is or if it symbolizes something.
The other answer is incorrect, or possibly overshooting the reference. Note that the Ushi no Toki Mairi is always represented with a voodoo doll and hammer, absent in depictions of characters "just going on a rampage" that you see. Also note the trend of being heavily armed, and wearing ammo belts across the chest.
In fact, we have to go back to 1938. Mutsuo Toi (都井 睦雄) murdered 30 people in a rural village, in what is known as the Tsuyama Massacre (津山事件). Feeling ostracized due to his tuberculosis, he carried out his grisly revenge heavily armed, wearing flashlights on his head. Presumably so he could see at night, but maybe in crude imitation of the Ushi no Toki Mairi. Still, this isn't quite it yet.
In 1951, Seishi Yokomizo (横溝 正史), the famous mystery novelist, wrote a novel called The Village of Eight Graves (八つ墓村). It concerns a family cursed with bloodshed, including one massacre of 32 people - modeled on the Tsuyama Massacre. This book was turned into a film by the same name in 1977. It stars Tsutomu Yamazaki (山崎 努) as Yôzô Tajimi (多治見 要蔵).
In the climax of the movie, Tajimi becomes possessed with the spirit of his bloodthirsty father and goes berserk, slaughtering men, women, and children to the tune of bizarrely heroic music. Somehow, it's framed as an avenging spirit's righteous final stand.
And this iconic scene is what stuck in the minds of the Japanese public. They're even making a figma of the character! From the flashlights to the weapons and ammo belts, this is it.
So to make it clear: Yozo Tajimi, of the film "The Village of the 8 Gravestones".
Now, there was another film in 1983, The Village of Doom (丑三つの村), which wasn't based on Yokomizo's novel but the actual original incident. Since they share the same inspiration, the main character looks similar, but I think it's clear that Tajimi is the one people reference.
For more references see this twitter thread.
It originates from Ushi no toki mairi
Picture taken from Wikipedia
Wikipedia Explanation
Ushi no toki mairi refers to a prescribed method of laying a curse upon a target that is traditional to Japan, so-called because it is conducted during the hours of the Ox (between 1 and 3 AM). The practitioner—typically a scorned woman—while dressed in white and crowning herself with an iron ring set with three lit candles upright, hammers nails into a sacred tree of the Shinto shrine. In the modern-day common conception, the nails are driven through a straw effigy of the victim, impaled upon the tree behind it. The ritual must be repeated seven days running, after which the curse is believed to succeed, causing death to the target, but being witnessed in the act is thought to nullify the spell. The Kibune Shrine in Kyoto is famously associated with the ritual.
The woman performing the curse is generally portrayed as dressed in white, with disheveled hair,wearing an iron "crown" that holds three burning candles, suspending (from her neck) a mirror upon her chest (which lies hidden) and wearing a pair of tall clogs (geta), She would then nail a straw doll representing her target to a sacred tree (神木 shimboku) at the Shinto shrine.
The iron "crown" that she wears is actually a tripod (五徳 gotoku) (or trivet, a stand for setting cooking pots, etc., above a heat source) which she wears in inverted, slipping the iron ring over her head and sticking candles on its three legs.
In Anime and Manga, this kind of action tells the Audience of the current genre. Usually this action in Anime/Manga is a joke (for entertainment purposes) not to mention the character you showed us wants to curse someone (except the genre of the manga/anime is a thriller or horror).