Had that happen to me. Got tailgated for about 10 miles on the interstate. Got tired of it and hit the brakes hard. I should have looked up cause it was a state trooper. As soon as he dropped back some he hits the blue lights. Guy had the nerve to ask we why I hit the brakes and told me that I was getting a ticket for reckless driving. One of the few times I have given a cop crap. Told him to go ahead and call his supervisor so that he could get a ticket for following to close and reckless driving. He got in his car and left 
i very rarely ever give police any crap. i did a lifetimes worth of that in my teens, and up till about 22 or so. BUT,,,,,,,,,,they are included in those that i will do it to. i don't care who it is. there's good reason to tailgate somoene....and there's no good excuse for rear-ending someone(short of catastrophic brake failure). it doesn't matter if the car in front hits his brakes for no good reason....still should be able to stop with him, or miss him.
