I encounter the term motif in composition books, and still have no idea what a motif is. Many sources (including some dictionaries) try to define it as "prominent sequence of notes" or "basic theme of a melody", or even "repeatable part". But hey, after all both brick and window are fundamental elements of a house. So, which one is the building block? Both? I mean, motif and measure and theme and melody are all considered building block of a piece of music. So, how do we can differentiate them?
A motif could be a melodic or rhythmic fragment. We're not talking about semantic building blocks like meter or harmonic language, but musical building blocks. The immortal example of a large-scale piece built off of a prominent motif is Beethoven's Symphony No. 5 in C Minor.
The first four notes are the rhythmic and melodic motif, which is used compositionally in transposition, inversion, and variation through the entirety of this first movement.
A "motif" is a basic sequence of rhythm and/or melody that is used as the "building block" to a "theme", which is a larger overarching musical idea.
NReilingh's example of the first movement of Beethoven's 5th is an excellent example of the use of a motif to create a theme. The four-note motif is an identifiable repeating block within the "theme" that is Beethoven's 5th.
Here's another example, a personal favorite of mine:
Another use of a motif is as a "Leitmotif" ("leading motif") in an opera, associated with a character, thing or idea. It can be long enough to be considered a "theme" but usually it is shorter; sometimes only a few notes or a single chord. Sometimes it is only played once at a time, but sometimes layered on itself or on other music in complex ways.
Some composers of music for animated cartoons used leitmotifs. Carl Stalling did the play-it-once thing in Bugs Bunny cartoons, quoting well-known pieces of music: "Powerhouse" for a factory, "The Lady in Red" when Bugs Bunny dressed up as a woman, etc.
The first Popeye cartoon had an original song, "Popeye the Sailor Man". The theme was used as a motif in all of the rest of the Popeye cartoons. At the beginning it might be heard in a jaunty rhythm as Popeye walks down the street. When he eats spinach, it is played fast and loud by a trio of trumpets, and then during the resolution it becomes a heroic march. This is based directly on techniques pioneered by von Weber, Wagner, and especially Liszt.