Some teachers might go as far as flunking your essays or even final grades. If they really do so, don't be afraid to speak up. If possible, you can politely ask you teacher why he/she is treating you that way. Perhaps you might be too sensitive at times; the teacher might not mean what he/she does. Asking your friends for advice as to how you can improve your character will also be a good idea.
Most teachers that ride particular students do so because they know they have a lot of potential and would like to see it. Try to be on your best behavior, but don't suck up a lot. You might give the wrong impression. If you really do think it is a problem, simply talk to the teacher. Be as mature about it as possible, pinpoint all the problems you've had in the class and simply ask what you can do to help alter the situation.
If you think your teacher hates you, then first you have to think about why he/she would hate you. Is it because you talk too much in class? Does he/she think you don't talk enough? Do you say things that bother him/her? If it's any of these, then you have to think about ways to avoid these habits. If you talk to your friends too much, then stop or start to sit in another seat away from them. If you talk out of turn, start to raise your hand more. If he/she doesn't like some of the things you say, think about what you plan on saying before you raise your hand, and if it is a comment that might be bothersome or rude.
If you feel like your teacher just truly doesn't like the kind of person you are, then why don't you try talking to him/her? A teacher will most likely be very impressed if you went up to her/him and said, "I feel like I've done something to make you dislike me, and I would like to start over because I really care about this class and your opinion of me." Try talking to your parents about it and see what they think you should do. Or if you have another teacher you are close to, ask that teacher for advice because it can give you perspective on how a teacher would want their student to handle this kind of situation. Good luck!
We all know teachers have a few kids they don't like, but sometimes teachers just have their bad days like any of us. If they snap at you it doesn't mean they hate you, they might have just awakened on the wrong side of the bed. If the same thing happens the next day and she/he bags on you again, then you just have to resort to the best possible way of dealing with it. You need to go talk to her/him. Share your feelings and just trying to sit down and figure out with her what's going on. Apologize if necessary and when in class behave like everyone else.