In Denmark, foreigners from countries outside the EU/EEA/Nordic countries have to carry their passport at all times to prove that their stay is legal. Their is no such requirement for people from EU/EEA/Nordic countries. People from these countries should be able to identify themselves, though. For Danish citizens in Denmark, there are no requirements of carrying ID whatsoever.
The police has the right to ask anybody to identify himself (to state his name and date of birth), even if no offence has been commited. The police can ask foreigners for passport/ID.