The Chonmage was a form of traditional hair-style worn by the samurai and other classes of old Japan.
Originally, the samurai, and later townsfolk, would shave the tops of their heads as it was supposedly more comfortable to wear the kabuto helmet this way. It has also been suggested that the early samurai would gather their hair and thread it through the tehen, the hole in the top of a kabuto, in order to hold the kabuto in place.
Once the top of the head had been shaven, the remaining hair, worn long, was then oiled with tsubaki (camellia) oil and gathered high at the back in a pony-tail like manner and tied with a string of tightly wound washi paper.
The oiled hair was then folded forwards, another tie would hold this in place so it could be worn sitting over the top of the shaved pate.
There were various styles of chonmage, and each had its own descriptive name.
In 1873, the Meiji Emperor had his topknot removed, and a more western styled haircut was adopted. This encouraged many to follow suit, however those refusing to conform to the fashion were called “Chonmageatama” which became a derogatory term.
Laws were passed in August of 1876, when the samurai class was abolished. With it went the wearing of swords in public and the rights to use them. Also the other symbol of the samurai, the chonmage topknot too was, by law, banned. Only sumo wrestlers were allowed to maintain the chonmage.
That particular law, although archaic, was never rescinded and remains in place to this day. Therefore if you were to grow and wear your hair in a chonmage style, you would in effect be breaking the law in Japan.