Filk is a subset of folk music that is practiced in, by, and for the Science Fiction and Fantasy fan community. People who write or sing filk are 'filkers'.
Filk in its earliest form was the setting of new, usually humorous, words to old tunes or settings of existing poetry to a suitable melodic line. Filkers still write many parodies and settings, but they also write songs that are original both in music and lyrics. These songs range from funny to heart-wrenching, silly to deadly serious, someplace in the middle or combinations of all of the above.
Filk is most commonly performed a cappella or by singers accompanied by a guitar. However, filkers use a wide range of instruments both traditional and modern, acoustic and electric.
Filk includes songs about every Science Fiction or Fantasy subject you could imagine: space flight, computers, books, movies, TV shows, creatures and aliens of every sort.
Filk also includes songs about things of interest to fandom and strongly resembles contemporary folk music. A small sampling of topics includes: cats, dinosaurs, Boston traffic, social commentary, and politics.
Filk also includes songs about fandom itself: attending science fiction conventions, running science conventions, singing and writing filksongs.
The precise origin of the word "filk" has been a subject of friendly dispute for many years. It definitely arose as a typographic error that was then adopted as a name for a previously-unnamed genre, but exactly where that typo occurred has been unclear. The most common story has had it appearing as part of a science fiction convention's program, but Lee Gold's research suggests that it first arose in the title of an article that Lee Jacobs submitted to the Spectator Amateur Press Society some time in the 1950's.
Note that filk is arguably defined more clearly than "folk" is these days, since filk explicitly reaches out to include songs both new and old, amateur and professional ... all of which are points of contention for many traditional folkies.
There is sometimes room for honest disagreement about whether a given song is or isn't filk, when it falls outside filk's core topics. (Or when it falls within them but wasn't intended by its author to be considered filk -- a situation sometimes referred to as "found filk".) Attempting to formally define an artistic genre always yeilds a fuzzy -- or even fractal -- dividing line, and often comes down to the personal preferences of the speaker, so I don't believe that a perfect definition is possible.
There have been many good attempts to come up with a good working description of what is and isn't filk, and if you're curious about where the boundaries lie you might want to glance over some of the others and see where they agree and differ. Summaries of many of these, and pointers to their full text when available, can be found here, courtesy of Interfilk.
But that's an academic exercise. We don't let disagreement over whether a song is or isn't filk stop us from sharing it with other filkers, if it's a good song and at least somewhat on topic. In fact, you don't really have to know any filk at all to participate in a filksing. In practical terms, almost any good song or brief story which follows the general themes or moods that have recently been sung about will be accepted and applauded. This leads to the claim that "filk is anything filksingers sing" -- which isn't quite true in principle, but works surprisingly well in practice.