My phone's battery has a problem and I need to replace it. I have a lot of important data in my phone and would like to whether changing the battery erases the data on the device.
As per GSMarena, Samsung Galaxy Note 4 has Removable Li-Ion 3220 mAh battery.
So, it doesn't affect your device anyhow if you change your battery to a new one.
Removable battery are easy to change. You can buy one from any Samsung Authorised store nearby. However, before going to remove battery off the device, make sure to turn off your device to prevent data loss, unwanted changes, irregularities or misbehaviour of device.
For more read user's comment on xda-developer's forum: Is it bad for the phone to pull out battery before shut-down?