Does anybody know what this antenna is used for? I suspect a glideslope antenna but I am not totally sure.
Glideslope antennas are those U shaped stubby 3 prong fork things that look like heating elements for a water heater. That's a 75 Mhz Marker Beacon antenna. I have revised this post. I thought it was just a VHF antenna, mainly because almost all Marker Beacon antennas you see out there these days are faired-in blade antennas, but the comment by @Gerry got me to do a bit more rummaging around, and found a couple examples of the same antenna as on that 172 and judging from the apparent length it's likely for Marker Beacon. That antenna is probably quite old and I'm not even sure you can buy one today, as all the news ones seem to be blade style.