R.K.
This is a learned behavior. If everything is fine at home she could be picking it up from some of the TV shows she watches. I have noticed that some of the so called kids shows will have a secondary character who has a smart mouth and is always saying inappropriate things or has a tone in their voice that screams disrespect.
My granddaughter was doing that a year or two ago and brought it up to my son. I simply told him I didn't like spending time with her because of her smart mouth and disrespectful attitude. He talked to her and told her that it wasn't cute or funny or cool and it stops or he doesn't allow her to watch her shows any more.
The only other way I can think of to stop it is to do the same thing to her. When she says something wrong or an opinion taht you don't agree with; yell across the room and say something like 'hey that's really dumb' better if done in front of someone else. When she hangs her head and walks away follow her and ask her how she liked to be treated that way. Then explain to her that others don't like to be disrespected either.
I hope that helps.