Two wrongs don't make a right.
Are you being funny and silly at inapprpriate times? Sometimes what is meant to be funny and silly can cme across as insulting and annoying. Talk to someone in your class and ask if maybe you have been coming off all wrong.
I mean if you have to TRY to get people to like you, and they end up liking you. They don't really like you for you.
But your last question may give a hint as to why there are people who feel that way towards you.