It looks like the sensor plug's seal is broken from the connector. Is there any way I can repair this?
Unless you're in a remote location and parts are hard to come by, it would be better to just replace it. Coolant temp sensors are usually fairly cheap.
I would say that if the sensor is broken, and everything's hooked-up, but the gauge isn't working then you'd be better off just replacing it anyway.