Halloween has been celebrated in some fashion or another for thousands of years. Next to Christmas, it's a holiday kids look forward to most every year.
Halloween started with the Celts in ancient Ireland. The Celtic calendar had the new year beginning on November 1st. They believed that on October 31st, Samhain, the spirits of the dead, could walk the Earth and would cause havoc. This was also the time when Druid priests could predict the future best because the veil between the living realm and the spirit world was at its thinnest. They would have huge bonfires, dress in animal skins to ward off or placate the spirits, and sacrifice crops or animals to the fire. The bonfire was used the next morning to light the hearth fires of all the homes in the village. There was the tradition of placing a "skeleton" (skull) on a window sill to ward off evil. These were usually carved from rutabaga or turnips and are most likely where our carved pumpkins find their inspiration.
Once the Romans took control of the Celts, new elements were added to the Halloween tradition. The Romans introduced Feralia, the celebration of the dead in late October, and a day to honor Pomona the Goddess of Trees and Fruit. Her symbol was the apple, and that is most likely where the tradition of bobbing for apples came from.
In around the 800's, the history of Halloween takes a more familiar turn. Christianity spreads across Europe, and the Pope decides to make November 1st All-Hallowmas (All Saints' Day) to honor martyrs and saints. Many believe it was to transition the pagan Celts into the Christian religion and give them a Church-sanctioned holiday to replace their heathen one. October 31st became known as All-Hallows Eve and November 2nd was designated as All Soul's Day, the day to honor the dead. People would dress up in costumes and build fires similar to Samhain celebrations. These 3 days were called Hallowmas.
Trick-or-treating probably gets its origins from the tradition of the parades held during All Soul's Day. On this day the poor would beg for food and families would give them an All Soul's cake. The church encouraged the giving of soul cakes as a way to replace the ancient practice of leaving food and wine for spirits. It was called "going a-souling" and eventually children began to do it, visiting the houses in the neighborhood in order to be given money, ale and food.