Renting a car in Cancun is not only a good idea but it is the best option.
To travel through Cancun and from Cancun to the Mayan Riviera there are several options such as: buses, which take you to and from the ADO terminal in the center of the city. Minivan, which offer shuttle service to and from the airport as well as taxis.
Traveling by bus or minivan can be cheaper, however you will have the discomfort of sharing the trip with other travelers as well as you will not have freedom of movement, since you will have to adjust to the itineraries established by these services. Traveling by taxi, on the other hand, is more expensive and does not give you the autonomy you need to fully enjoy a trip.