Well, the only way to verify an iPhone is real or NOT, is through it's serial number or IMEI/MEID. You can find the serial number or IMEI, by going to the "Settings -> General -> About" section of the iPhone. Once, you get the serial number or IMEI, you can then go to check coverage page of Apple: Check Your Service and Support Coverage - Apple Support and type in the serial number, or IMEI and check its coverage status. If the serial number shows in with device warranty information, then that iPhone is a real iPhone. However, this page will NOT be able to tell you if the iPhone is blacklisted or iCloud or carrier locked. Blacklisted iPhones are those iPhones, which are reported lost or stolen by the original purchaser. Once the device is blacklisted, you may NOT be able to use it with any carrier/network, as carriers do NOT allow blacklisted phones to be used on their networks. The only way to check if the device is blacklisted on NOT, is through going to some 3rd party sites which offers checkup using IMEI, but still I would NOT rely on the integrity of their results. Apart from it, there are lot of iPhones which do comes carrier locked, and you are required to use them on that particular carrier, or request that carrier to unlock it for you, by meeting their certain requirements. It entirely depends on the carrier and Apple will NOT be able to help you in this regard. So, to be just on the safe side, I would recommend purchasing it directly from Apple store, or any authorized retailer.
Hope this answer's your question!