Mac Book Pro 2012 model: My sharing name automatically changes
Just to make sure you're changing your computer name in the right place, follow these steps:


Go to System Preferences
Click on Sharing
In the Computer Name field, enter the name you want your computer to use.
Exit System Preferences


Now, assuming you were already doing that, you should reset your NVRAM.

Reset your PRAM/NVRAM

Older Macs had what's called Parameter RAM (PRAM), newer Macs use Non-Volatile Random-Access Memory (NVRAM). You should definitely reset this to try resolving your issue. Follow these steps:


Shut down your machine. Yes, a full shut down, not just logging out.
Press the power button and then press the commandoptionpr keys. You have to make sure you press these keys before the gray screen appears or it won’t work.
Hold those keys down until your Mac reboots again and you here the startup chime.
Let go of the keys and let your Mac reboot normally.


Note: When you log back in you may need to readjust some of your system preferences (e.g. mouse speed, time and date/timezone, etc).