How is a Class E airport distinguished from a Class G airport, based on 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).