A lot depends on hangar and maintenance costs in your area. Airplanes hold their value much better than cars, so it's quite possible that you could buy a plane, learn to fly in it, and then sell it for as much as or more than you paid for it, saving the cost of 60-70 hours of renting. OTOH, you could have major unexpected repair costs which could cost a lot more than renting. It's a gamble. The availability of rental planes is also a factor... if the flight school has lots of planes, good, but some schools have only one or two planes and it can be hard to schedule time in them, especially if one is down for maintenance.
The C-172 is a good plane, I'd suggest looking at smaller planes, perhaps a Cessna 150/152, or even an older light plane like a Cub, Taylorcraft, Aeronca, etc. The smaller planes are cheaper to operate and maintain, and more difficult to fly well, so they make you a better pilot.