How is a Class E airport distinguished from a Class G airport, based on the identifier? Some small uncontrolled airports have "K" identifiers such as KPHK (Palm Beach County Glades) "Pahokee". Others such as 42M (Thayer Mem) "Thayer" have a numeric identifier. Both have 122.9 CTAF listed. Pahokee is Class G, Thayer is E. 

My question is how is an "E" airport distinguished from a "G" airport on the basis of the identifier?
Airport identifiers do not distinguish the airspace that surrounds them. As for why airports start with a K you can look at the answer here. To figure out the airspace that an airport sits in you must look at the airspace designation lines around it (see page 10 here).