Some people here have suggested that not complying with the request (demand) for an ID is the way to go. I'm not going to dispute that but I would add one thought.
If you are trying to educate the LEO that what he is doing is wrong or unlawful, then this is the wrong way to go about it. 99.9% of the people I arrested or ticketed claimed that they were innocent, or that I couldn't arrest them, or that what they were doing was legal. When you claim that they are violating your rights or that their demand is unlawful, all they hear is blah, blah, blah.
If you really want to get your point across, then comply, let the cop have his moment in the sun, and then file a formal complaint with the department. If this were to happen enough times, believe me...the LEO's superiors will come down on him/her like a ton of bricks. The last thing they want are MORE citizen complaints, especially when the citizen is right.
I'm not saying that you HAVE to do this, but it is an option to consider. Your actions should be dictated by the situation and by your own personal preferences.