Contact the owner and tells him to disassociate your Apple ID for that device.
At that point, you can restore the iphone (DFU mode) and install it, and you believe ID is recorded to fire and only that can restore.
If you can not contact has a problem. Need to go to an Apple store with the bill.
If you do not, nor can contact the owner, assume you have a paperweight, perhaps stolen. Leave it to the police station for any occurrence of their legal owner and that no one else will.
PS: It is quite common in a sale of an iPhone, which sold on ebay or the like, catch the money and then to report the theft and clog, to recover once it has some good Samaritan (maybe it's the case).