Is there a setting to make the Mac not change resolution when connecting to an external display? I am currently running 2880x1800 resolution on my MacBook Pro retina (using the command setgetscreenres).

Whenever I connect to an external display, my Mac changes to a lower resolution. Is there a way to disable this behavior?

Also I've noticed that sometimes instead of extending the display, it mirrors my display on some external displays. I don't think I will ever use mirror mode, so is there another setting to make all external displays extend?
In mirroring mode, both screens need to use the same resolution.  The external display probably can't support the huge 2880x1800, so it's lowering yours to match.

In System Preferences > Displays > Arrangement tab, uncheck the mirroring option.  Then you should see two separate preferences windows, allowing you to set different resolutions for each display.  Note — the Arrangement tab is only visible when you have an external display connected.

http://support.apple.com/kb/HT5266