For the source, go to end of the answer
Suppose one day you got one note which has some thing written to it, say "Major frequency components are 10 Hz, 25Hz, 50 Hz and 100 Hz". Somehow, you understood that its time-series representation is a very important thing (may be master-piece work of a great musician, or some national security matter, anything). So you decided to find it.
You start by plotting the spectrum which looks like below:

(There can be some noises/disturbances in between these frequencies, but most people neglect it)
Now you want to find its time-series representation. Since we have worked it a lot in our signal processing class in college, most probably, we get below signal:
$$
x(t)=cos(2 \pi 10 t)+cos(2\pi 25 t)+cos(2 \pi 50 t)+cos(2 \pi 100 t)
$$
Great !!!
But is this the only time series representation for those frequencies?
Consider another time series signal which plays a sine wave of frequency 100 Hz for 300 ms, then 50 Hz sine wave for next 300 ms, then 25 Hz sine wave for 200 ms, then 10 Hz sine wave for 200 ms. A total of 1000 ms long signal. If you plot it, it will look like below:
Actually above signal also have similar frequency spectrum (shown below):

Those ripples are because of sudden changes in frequency. Amplitude changes are because of change in how long each frequency was played. They are not of importance to us right now.
So what to do now? How will you pick one? Even if we change the order they were played, still we get the same frequency spectrum. So how many such combinations you have?
In short words, without knowing when those frequencies were played, it
is very difficult to find its time series representation, and that is
where, wavelets come into picture. It provides not only the
frequencies present in the signal, but also, the time it was present
in the signal.
UPDATE (17-Feb-14)
Question : How do you relate that we require both spatial (time) and frequency information in an image at a same time ?
Answer : Me too, had the same question before, so after seeing your comment, I thought I should find one example (I haven't studied wavelets in the context of images before wavelets). And below explanation is the summary of an answer in Quora.com
(all credits to that author, Ron Reiter) which I felt as a good example.
You might be knowing that we use the DCT for jpeg compression of images. It preserves the low frequency data while throws away some of the high frequency data in the images, based on the image quality we need.Or in other words, this method is good with low frequency data, but not that accurate with high frequency data.
For example, in an image with sky and a tree, the areas of sky will be preserved accurately while some details of tree will be thrown off.
In DCT, we take 8x8 blocks of images and encode it for all frequency of data. For very low frequencies, we could have used higher block size while for very high frequencies, we may have to use lower block size than this.
Now apply our wavelet method as explained in 1D case above. What if we can find both frequency and their location in the image? We can encode the low frequency areas in big chunks while high frequency areas in low chunks. So it produces better results.
Please check the link for more details
SOURCE:
- THE WAVELET TUTORIAL by ROBI POLIKAR
- All the images, explanation, everything, are extracted from this link. It is a must-read introduction of wavelets to beginners
- Amara's Wavelet Page
- Wavelet in image compression - Ron Reiter at Quora.com