Siddharta practices austerities, before reaching enlightenment
Gotama traveled through India and studied under a few teachers. He absorbed everything quickly and was soon their equals. This left Gotama with no-one to teach him. After he left his last teacher, he met 5 men who had left a life of ease and riches to become wandering monks. Their names were Kondanna, Bhadduya, Wappa, Mahanama, and Assaji. These men became Gotama's most trusted friends and they watched over and protected him during the next phase of his life.
Like his 5 friends Siddharta spent 6 years pushing his body to its limits. He lived on 1 grain of rice a day and meditated constantly. He withered away to a skeleton with skin stretched over the bones. Finally, one day he said, "This is not the way to find the answers I seek."
A young girl prepared rice-milk to give to the young Gotama. She found him sitting under a Banyan tree and offered him the rice milk, he accepted. He thanked her graciously and bathed in the river next to the tree. The other ascetics were scandalised and left. They thought he was no longer serious about the spiritual quest, why else would he stop starving himself?
After he bathed, he sat under the tree and said, "I will not leave this spot until I have achieved enlightenment."
He meditated for 5-7 weeks (some accounts say 5 weeks, others say 7...) under the Bodhi tree. During this time, the demon Mara tried to distract him with temptation. He was tempted with the beautiful daughters of Mara and with his army. Siddharta was neither tempted by the beautiful girls, nor afraid of the army.
Ultimately he touched the earth under the bodhi-tree and called upon her, the earth, to testify that he deserved to be left alone, based on his previous good deeds. Mara backed off and Siddharta gained enlightenment at the end and became the Buddha.
He had a choice - he could vanish from Earth into Nirvana and become absorbed by the universe, or he could stay to teach others how to achieve enlightenment. Buddha was doubtful that his insight and state of consciousness could be taught, but in the end, at the urging of Brahma, Buddha decided to stay and teach.
The Buddha searched for and found his 5 friends that had deserted him. He talked with and befriended them again. They became his first followers and learning the four noble truths, became arhats.