Welcome to Android Central! Does the earpiece work for anything? That speaker might have failed. You can hear things on the speakerphone because it's playing over the main external speaker, not the earpiece. Contact ZTE if your phone is still under warranty; otherwise, consider bringing it to a repair shop.