(literally) Used to ask someone for a favour (may be polite or sarcastic).
Could you possibly do me a favour and pass me that newspaper?
Do me a favour and shut up.
(UK, idiomatic) Expressing incredulity.
You expect me to clean up all this mess for you? Do me a favour.