What would happen if the world ran out of usable gasoline?

A lot of different things are possible under different scenarios. What's your time scale for turning off the taps?

Since the supply of fossil fuels is finite, your postulated future is all but inevitable. At current rates, though, renewables would be perfectly capable of keeping pace with a realistic decline for fossil fuel use. Solar/wind is already beating out coal in many places around the world for grid supply of electricity. With ground transportation going electric, the days of gas stations are numbered as well, eliminating a major sector of oil consumption. The natural order of things (market landscape, public policies) seem to favor two or three decades for the flip that will see electric cars reach parity with or overtake gas vehicles on the road.

/r/AskScienceDiscussion Thread