Police are supposed to enforce the law, but that does not mean they can go out of their way to convince you to break it just so that they can arrest you. Doing so is known as entrapment. If you do get arrested in this fashion, you may be able to use that entrapment as a defense, essentially claiming that you would have followed the law without police involvement.
For instance, imagine that you go to the local bar. You drive there, planning to have a beer and a burger before safely heading home. You get talking to a man at the bar, though, and so you keep on buying drinks. The conversation goes on until the early morning.
That's when you decide it is time to call a cab. You stand in the parking lot, trying to look up the nearest ride service on your phone.
As you do, the man you were talking to tells you that you should just drive home. He assures you that your house is close enough and you'll get there safely. You say that you would rather call a cab, but he tells you again that it would be easier to drive.
At this point, as intoxicated as you are, you decide to do it. Once you start your car, though, the man pulls out a badge, says that he's an undercover officer, and arrests you.
Did you get arrested through entrapment? It is more than unfair; it is illegal. Make sure you fully understand all of the defense options you have as your case moves forward.