What will happen to a police officer if he lies about being a police officer?

If you are referring to "undercover" officers, plainclothes detectives, or "tactical old clothes" officers, they are not lying to anyone because they are not under oath to tell the truth.