If you get an iPhone from used marketplace and find that it requires Apple ID and password to activate the device, it is very likely a stolen iPhone. Unfortunately, you have no way to find it out until you get the phone. But you can try to these unlocking iCloud tips.
Note: It is a temporary solution to bypass the iCloud lock and access your iOS device.
For users in USA/North America, the new DNS is 220.127.116.11
For users in Europe, the new DNS is 18.104.22.168
For users in Asia, the new DNS is 22.214.171.124
For users in other area, the new DNS is 126.96.36.199
Step 3. After you have entered the right DNS, tap the "Back" button and click "Activation Help".
When you have successfully completed the above steps, you will receive a message saying that "You have successfully connected to my Server", which means that your device is activated and you now are able to most of the major functions of the device, including the settings.