Insulting a police officer is never a good idea, but it's a separate issue whether you can be arrested for it.
Those who get in officers' faces either with their words, actions, or even photography, are often arrested under statutes which prohibit obstructing officers in their investigations or arrests.
Can you legally be arrested for insulting a cop? There are many different types of insults you can hurl at law enforcement officers, and each of them may have a different legal consequence.
Flipping Off an Officer
Understood by almost everyone as an insult, if you decide to flip off a cop, you may be in the legal clear. Federal courts have ruled that the sole act of giving a cop the finger does not qualify as evidence of criminal activity.
Cops, however, are still people, and they are well within their legal rights to take notice of you when you give them the finger. Seeing the bird may not give reasonable suspicion for a traffic stop or detention, but officers are free to examine you like a hawk to see if you are breaking any laws. This may or may not lead to an arrest.
'I Smell Bacon'
Teasing or deriding officers' authority by calling them "pigs" or "rent-a-cops" isn't grounds for an arrest. Broad state and local laws which allow officers to arrest suspects simply for verbally challenging them during an investigation or duty have been struck down by the Supreme Court.
However, like the finger, if you plan on saying "it smells like bacon," you better hope that your car doesn't smell like pot.
Many cop-insult arrests are made possible through disturbing the peace statutes, which may prohibit using challenging or violence-inciting words. The Supreme Court has recognized that although you have a First Amendment right to free speech, there are certain words which are more like a punch than actual speech or ideas. These are called "fighting words."
Law enforcement may argue that you were inciting or challenging an officer to fight with your insults, and they may legally arrest you. Then again, the Supreme Court also noted that it wasn't fighting words for to picket a military funeral with a sign saying "Thank God for Dead Soldiers," so what actually qualifies as "fighting words" is unclear.
Even if it is legal to insult cops, hurling insults at officers may draw their ire and attention to other suspicious activity. So try to be nice.