How to remove a previous owner’s Apple ID from a used iPhone, iPad, or iPod touch
Apple's iOS devices (iPhone, iPad, and iPod touch) use a security feature called Activation Lock, which is designed to prevent others from using your device if it is lost or stolen. This is a great anti-theft device but can make things difficult if the previous owner moved the device on purpose. For example apps such as pdf scanner ocr are difficult to move.
If Find My is already activated, Apple stores the device's serial number in the company's database with the Apple ID as part of the activation key. Even after a hard reset, the device will check Apple's database and see if the feature is being used based on the device's serial number. The Apple Store can remove it, but probably not unless you can prove beyond doubt that you own the device. They often push you away and say they can't do it.
The best way to resolve the issue is to contact the previous owner and ask them to remove the device from Apple's IRU. They can do this by entering a password on the activation lock screen or by using iCloud. If the previous owner decided to restore iCloud, you should do so.
1. Sign in to iCloud.com.
2. Click Find iPhone.
3. Open the list of devices connected to your account by clicking All Devices at the top of the page. This list shows the list of devices connected to your iCloud account, regardless of whether they are connected to the Internet or not. If it's a household account, each family member's items will also be displayed.
4. Scroll through the list until you find the device you want to remove. Click on it. The page shows some units. Click Remove from Account to remove the account from iCloud.
5. If the device was removed by the previous owner, restart it by turning it off and on.
If you can't contact the previous owner, you might be out of luck, or if the person you bought the device from can't or won't do it for you, you might have bought a stolen device and it was stolen. If you can confirm that the device was legally owned by the previous owner and was sold to you, you can try contacting Apple Support to request an activation key.
A good reminder for anyone who wants to donate an old device: to avoid this problem, be sure to follow the correct steps to remove the device from the previous owner's Apple ID before the event.