How to differentiate real and fake China IC

I think if you buy a chip from a reputable distributor (Digikey, Mouser, Arrow, RS, etc.) then you can have good confidence that's a genuine chip to use as your reference. Even better would be to get it directly from the manufacturer. It is possible to get samples, though that might depend on the company and how promising you can make yourself appear as a customer. I know Microchip/Atmel has an online store where you can buy chips for a reasonable price.

You should be able to identify a counterfeit with a different design by decapping but I've also heard concerns that the IC manufacturing plants run extra unauthorized runs of chips that will use the official design but minimal quality control. Those wouldn't be detectable by decapping.

I think it would be interesting if someone investigated the ATmega328P chips on the dirt cheap Chinese boards. I've seen other chips investigated projects but not ATmega328P, other than the completely bogus non-working ones Sparkfun bought, which I think is an outlier.