How do you get a child to stop talking back?
Outplay children at their own game
The first thing you need to understand is that children engage in emotional responses. When you engage in emotional responses, when you try to keep up with them, you will lose. They can and will outlast you. What you must do is beat them at their own game.
Instead of telling them what they must do, give them choices that you can accept. Instead of telling them to do their homework now, tell them they can do their homework now or after they help with the dishes. When they give a smart answer, just reply, "What were the choices?" Any kid worth keeping will come up with a smarter reply. But don't fall into the trap of trying to outwit them. Just reply, "What were the choices?" If you will keep your cool and stick with the reply, soon they will give up.
If they make some smart remark about what you are serving for dinner, have a ready reply, "You can eat what is on the table or breakfast will be served at 7 in the morning." You can expect some smart remark in reply. But do not fall into the trap of playing their game. Your reply should be "What were the choices?"
Of course, sooner or later, you'll hear the "I'm going to run away from home" routine. Your answer should be, "I'm sorry to hear that. We'll miss you."
When they tell you things like you are not a good mom or "I hate you", a good response is, "Nice try, I used that when I was your age. Didn't work for me either." And stick with that. For each smart reply, just say, "Nice try. I tried that when I was your age." They will very soon tire of the game.
You should understand that all these comments must be said with a smile and empathy. Do not be sarcastic. That will only increase their anger. Just be polite, and say, "What were the choices?" You will be able to keep your cool and it will be fun to watch them run out of things to say.
If you really want to learn more about this, I suggest you look up Love and Logic. They do a wonderful job of teaching parents how to deal with all types of problems raising children.