asking for it or trouble

Meaning
behave in a way that is almost bound to provoke trouble
Example To insult a thug like that is just asking for it.