Is there a setting to make the Mac not change resolution when connecting to an external display?
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