It is not the law, but in most police departments there is an internal department policy that requires identification of the individual officer when asked. It is relatively straight-forward to reconstruct the identity of the officer, based on time, date, place, and other employee-created records that account for individual work time and activities. So if you have a complaint about officer conduct, make it to the Internal Affairs Division even without the specific name and badge number.
It would not be proper or lawful for an officer to make an arrest based on nothing other than a request for his/her name and badge number. On the other hand, it is hard to that such request isn't preceded by some important facts, so it is possible that there are sufficient grounds for arrest.
My responses to questions on Avvo are never intended as legal advice and must not be relied upon as legal advice. I give legal advice only in the course of an attorney-client relationship. Exchange of information through Avvo's Questions forum does not establish an attorney-client relationship with me. That relationship is established only by individual consultation and execution of a written agreement for legal services.
I know of no law.
I am a former federal and State prosecutor and now handle criminal defense and personal injury/civil rights cases. Feel free to check out my web site and contact me at (212) 385-8015 or via email at Eric@RothsteinLawNY.com. The above answer is for informational purposes only and not meant as legal advice.