Lent is the 40 days before Easter in which Catholics pray, fast, contemplate, and engage in acts of spiritual self-discipline. Catholics do these things because Easter, which celebrates the Resurrection of Christ, is the greatest holy day of the Christian year (even above Christmas) and Catholics have recognized that it is appropriate to prepare for such a holy day by engaging in such disciplines.
The reason Lent lasts 40 days is that 40 is the traditional number of judgment and spiritual testing in the Bible. Lent bears particular relationship to the 40 days Christ spent fasting in the desert before entering into his public ministry. Catholics imitate Christ by spending 40 days in spiritual discipline before the celebration of Christ's triumph over sin and death.
Fasting is a biblical discipline that can be defended from both the Old and the New Testament. Christ expected his disciples to fast and issued instructions for how they should do so. Catholics follow this pattern by holding a partial fast on Ash Wednesday and Good Friday. Abstinence from certain foods is also a biblical discipline. The only kind of flesh Catholics eat on Friday is fish, which is a symbol of Christ.
Even the Ash Wednesday practice of having one's forehead signed with ashes has a biblical parallel. Putting ashes on one's head was a common biblical expression of mourning. By having the sign of the cross made with ashes on their foreheads, Catholics mourn Christ's suffering on the cross and their own sins, which made that suffering necessary.
The time of Lent, through fasting and abstaining, should be an important reminder of what it means to suffer. This small suffering should not be met with misery, but with great joy as we better understand the incredible sacrifice that Jesus Christ made for all of us.