Undercover police do NOT have to identify themselves if asked, courts have proven that identity deception is often required to catch criminals.
The only source I could find on this subject quickly was here
http://www.erowid.org/freedom/police/police_info6.shtml