A songwriter is someone who writes either the lyrics or the music for songs. The same person may write both. Writing the music is also called composition. Sometimes the word composer is used interchangeably with the word songwriter though, strictly speaking, they are not quite the same thing.
The word is used most usually when talking about popular songs, although is sometimes used when talking about art songs as well; it is true to say that Franz Schubert, for example, was a songwriter, even if it isn't something which is said very often.
Songwriters may sing the songs they write themselves, or may write for somebody else to sing. People who sing their own songs are nowadays typically called singer-songwriters, although the tradition of doing this dates back hundreds of years. It is often speculated that pre-historic man must have made up and sung songs. More recently, the troubadors of the middle ages sang their own work, as did the German Minnesingers.
Most art song writing is written for somebody other than the composer to perform, although it is known that Schubert often sang his own songs at private parties, and there have been a number of composers who were also singers and wrote for themselves, Carl Loewe being one example.
Many modern rock and roll bands have one or two songwriters, often members of the band. In many cases, the lead singer one of the song writers.
There have been quite a few popular songwriting teams such as the Tamla Motown team of Brian Holland, Lamont Dozier and Eddie Holland and the teams of Lennon and McCartney, Lerner and Loewe, George and Ira Gershwin and Rogers and Hart.