Is it possible to fly a Cessna 172 vertically?
Might be a good idea to stay humble.  Any type of acrobatics may not be recommended if the aircraft has
a gravity only fuel feed.  Keep in mind if (for example you attempt a loop) and you only make 1/4 of the way through (and are nose up and have lost all forward airspeed), 5 things can happen. Fall straight down tailfirst (will not last long as this is most unstable and the nose wants to be down), tip left, tip right, nose drops back to horizon, nose falls INVERTED to horizon.  The last one I would not want to be in.
Tipping left or right can be helped with rudder and is known as the "stall turn" or Hammerhead.  Nose dropping to horizon would be similar to a stall recovery.  

There are aircraft much more suited to do this and qualified people who would be happy to take you up and show how it is done. You may wish to speak with them.