Parvati took some clay of a pond and fashioned the clay into a very handsome son. She dressed the son in beautiful clothes and jewellry. He was named Ganesha. Parvati told Ganesha, You are my son. Stand at the gate and do not allow anyone to enter.
Ganesha picked up a rod and began his duty as sentry. Parvati went to have a bath.
Soon Shiva turned up with his companions. Where are you going? asked Ganesha. You cannot pass. My mother is having her bath.
I am Shiva, answered Shiva.
Who is Shiva? retorted Ganesha. I don't know of any Shiva. You cannot go in.
Shiva tried to ignore Ganesha and enter, but Ganesha started to beat Shiva with the rod. Shiva then asked his companions to remove this upstart. But they only got thrashed by Ganesha in the process.
Nandi tried to grasp one of Ganesha's legs and Brhringi the other. But Ganesha uprooted a wooden door and beat them so hard that they fled. The gods and the sages all came to see what the uproar was about.
Shiva told Brahma, Why don't you try to pacify that creature?
Brahma advanced to reason with Ganesha. But Ganesha didn't know Brahma; he thought that this was another one of Shiva's companions. He therefore grabbed Brahma and tore off Brahma's beard by the handful. Brahma fled in pain.
This had become a matter where Parvati felt her pride to be at stake. So she kept Ganesha supplied with weapons. The gods attacked Ganesha with all sorts of weapons. He drove them back.
Vishnu told Shiva, This fellow can only be killed with some trickery. Otherwise, he seems to be invincible.
Ganesha flung a mace at Visnu and hurt him considerably. He struck down Shiva's bow with another mace. Vishnu and Ganesha then began to fight, with the sudarshana chakra being used by Vishnu and maces by Ganesha. While this duel raged, Shiva crept up stealthily from behind and cut off Ganesha's had with his trishula (trident). This was the trickery that Vishnu had planned for.
When Parvati learnt of Ganesha's death, her ire was roused. She got ready to destroy the universe and everyone was alarmed. Narada was sent to Parvati as a messager. He was to try and pacify Parvati. But Parvati agreed to relent only if two conditions were satisfied. The first condition was that Ganesha should be brought back to life. The second condition was that Ganesha should be accepted as a god and should enjoy all divine rights.
These conditions wre readily accepted. Ganesha's headless body was cleaned and bathed. But the head could not be found. It had been lost in the heat of the battle. Shiva sent his companions out with the head of the first living being that they saw. This happened to be an elephant with one tusk. The elephant's head was stuck onto Ganesha's body and Brahma, Vishnu and Shiva combined their powers to bring back life to the dead body.
Shiva accepted Ganesha as his son. He also made Ganesha the lord of all his companions, the ganas.
That is why the elephant-god is called Ganapati. It was also decreed that worship to any god would be useless unless it was preceded by prayers to Ganesha.
Chaturthi tithi is the fourth lunar day. Krishnapaksha is that part of the lunar fortnight during which the moon wanes. Since Parvati created Ganesha in the month of Kartika and on chaturthi tithi in krishnapaksha, that is the day on which Ganapati is worshipped.