If you purposely acts a certain way to irritate one of the consequences is that those people will probably become irritated, and certainly like you less. If this annoys you & you act on that IRL you may end up with reduced liberties or funds.
If you feel you are being bullied the 'right thing to do' is tell the teacher. The mature thing to do is just take it in your stride, satisfied that you were trying to get a rise out of them & succeeded.
If you were not acting to deliberately antagonise an apology & a sincere attempt to curb that behaviour in future is probably the best course of action.
As with other things, others can only guess your true intent based on previous patterns of behaviour.
Fair enough. Lets finish.