If you have purchased songs and apps then transfer them to the computer: File>Transfer Purchases
Then erase and sync.
You have no legal right to anything purchased by the previous owner, so that will be erased.