The icloud prompt could keep coming up asking for the icloud password. It sucks when you forgot the icloud password, and at the same time forgot the password to your corresponding email.
Factory reset (Settings -> General -> Reset) won’t do it, coz after the reboot it will again keep asking you for the icloud password. And there is no way to log out or switch the existing icloud login username.
You will have to reset it with the DFU mode. You will need iTunes.
Entering DFU Mode on iPhone, iPad or iPod touch
- Plug your device into your computer with a USB cable.
- Turn off the device.
- Hold the Power button for 3 seconds.
- Hold the Home and Power buttons for 10 seconds.
- Release the Power button but keep holding the Home button.
- After about 15 seconds you will be alerted by iTunes saying that it has detected a device in Recovery Mode.
iTunes can then factory-reset everything on your device. The icloud prompt will now ask you for a new icloud login.
https://discussions.apple.com/thread/5469616?tstart=0
https://www.theiphonewiki.com/wiki/DFU_Mode