Discuss and learn French: French vocabulary, French grammar, French culture etc.
It is definitely a trap. A young woman addressed as Madame might be insulted because you think she looks old. An older woman addressed as Mademoiselle might take offence because you imply that nobody would want to marry her.
I think the default is Madame, but switch to Mademoiselle if she's really obviously young, or if you intend to flirt.
To stay on the safe side, I usually don't use any of them, unless I know for sure. Just say bonjour and you'll be fine. Do you really need to say madame or mademoiselle?
As stu harris said, it's a trap. I just don't step on it.
Hope this helps.
It can be considered rude to just say bonjour.
When I worked in Paris I used to just use Bonjour until my boss told me that it is very unappropriated.
To be on the safe side,
If you see a woman who is less than 18 years old than use Mademoiselle.
If she is older than use Madame.
When ever you are not sure use Madame.
Its a tricky one as Stu said.