My old iphone keeps my settngs I gave my old iPhone 4 to my friend and it has been unlocked however we seem to be linked as she receives all my shared photos. Now she wants to set up Gmail on her phone and it seems locked on my email address. Can you help please.
Is the phone locked to iCloud? If it is then I refer you to this answer. 

Assuming no, then you will just need to wipe the phone. Assuming that you have backed up your data (music, photos etc) then open the Settings app. 

Go to General -> Reset (scroll to the bottom) -> Erase All Content and Settings -> Erase iPhone



Wait a while (it can take some time) and then the phone will be as new. It will welcome you with a "Welcome" message.



That's it!