Bought an IPhone can't download apps?

I bought an iPhone from someone online. It's fine except I can't download any apps because it keeps asking me for their apple Id and password before I can download which of course I don't have. Is their anyway I can change this account with my own details? Or am I stuck?

Reset your mobile and crate new apple id which is free if you don't want to buy apps or games. OR jailbreak your i-phone and use apps like i-tools and install apps and games