Thermohaline instability and rotation-induced mixing I. Low- and intermediate-mass solar metallicity stars up to the end of the AGB