One of the oldest instruments discovered by archaeologists is a flute made out of animal bone. It is dated to be many thousands of years old!
The flute is commonly portrayed in Medieval artwork as a horizontally blown flute with six holes, as opposed to the vertically blown recorder. Most commonly used in secular music (outside of the church), the flute would have been used in dance music!
In the renaissance, the most popular flute was in the form of a blockflöte, more often referred to as a recorder. These instruments were played in consorts, recorder ensembles that included many different ranges of vertical flutes from contrabass (very large) to garklein (very small)!
Traverso, known more commonly as baroque flute, begins to resemble its modern counterparts. Many of the oldest pieces of flute ensemble repertoire were written in this era, such as the Boismortier Concertos for five flutes.
The flute was used commonly in operas, symphonies, and as a solo instrument quite often in the Classical era. The most commonly called for work at auditions is Wolfgang Amadeus Mozart's Concerto in G major, a piece that most flutists know fondly!
The flute lost popularity throughout this era but regained it toward the latter half due to the prevalence of the Paris Conservatory. Near the turn of the 20th century, much of the repertoire that is commonly played today was written for the instrument as we know it today. German inventor and avid musician Theobald Böhm helped to modernize and revive this instrument, many developments of which have been left unchanged!
The bridge between the Romantic and Modern eras brought about Impressionist and Expressionist movements in both art and music. Composers like Debussy and Ravel used the flute to represent various aspects of nature as in the Afternoon of a Faun or the ballet Daphnis and Chloe, respectively!
The stable version of the flute led to much experimentation with odd sounds. In addition, technology as we know it today brought a new medium of which to make music. So between experimental works with electronics, neo-classical and neo-romantic works, and everything in between, there is music written today for just about everyone's taste!