Your best bet is to not even try. Stick with buying directly from Apple or at&t because honestly, it is your only sure fire way of knowing that the item is real. I buy things off craigslist sometimes, but i would be careful when doing that. There are some crazies out there. But dealing locally is always easier, just take someone with you or meet at an Apple store or an AT&T store. Or if you are buying from ebay, buy from a seller that has no less than 99.8% positive feedback. And make sure that they specify that the item is an actual iPhone, not a replica. If you need to, get the esn from the seller and call Apple yourself and check first. That way you know if it is real and if the esn is good.
Good luck!!