The earliest reference of a Karva Chauth - Great Epic of Mahabharata.
As per Mahabharata, Arjun, a supreme warrior and one of the Pandavas, went to the Nilgiri Hills to offer his prayers and worship the gods. Draupadi, wife of the Pandavas, was accompanying him. On the way, Draupadi was struck with fear believing that she was alone in the forest with no one to protect her. As she treated Lord Krishna as her Brother, she invoked him to appear before her and help her out of this grave situation.
On listening to her fear and perplexity, Lord Krishna cited an example of Goddess Parvati. Parvati in a similar situation asked Lord Shiva's help. Lord Shiva explained to her that to ward off such apprehensions, a woman could observe a fast on Kartik Krishna Chaturthi as a remedy. Lord Krishna advised Draupadi to undertake this fast and also assured her of he victory of the Pandavas. Women also pray to Lord Ganesha for the fulfillment of all their wishes.
The fast has all the trappings of festivity. Women dress up in their best finery, with henna-decked hands, bindis, colorful bangles, vermilion in their hair-parting and the best of jewelry. However, they do not eat even a morsel of food, neither drink a drop of water, from dawn till the moon rises. Finally, when the moon is sighted, the wife goes out to view it. The moon is worshiped and then she turns to view her husband's face through the pores of a sieve, praying for his long life. After performing the puja, its finally time for food.