Are you seeing an Activation lock? Are you getting a request for the ID when accessing iTunes or the App Store?
If for iTunes or the App Store, those purchases are tied to the other ID and can't be transferred. One option is to delete the apps/purchases made by the old ID and download them using the new ID if desired.
If you are seeing an Activation Lock, if this is a used device, you will need to contact the seller to have them log out of iCloud or go to iCloud.com/Find My Phone and erase the device, then remove it from their account. If you can’t do that, the device is useless.
Activation Lock - Turn off Find My iPhone
If you are the original owner, take the device, the original purchase receipt, and a photo ID to the nearest Apple Store.
or contact Apple ID Support. They will need to see the original purchase receipt/paperwork also.
Apple Support by e-mail or chat Select your device, Battery, Power and Charging, then Power adapter not working to get a chat option.
Or fill out and submit this form.