Bereshit 12:4 Lot went with him (Avraham).. 13:1 Lot with him (Avraham).. 13:5 And Lot also, who went with Avram..
After these points Lot goes on a seperate way from Avraham, but HaShem still shows His compassion (mercy) for Lot (Bereshit 19:16) and saves Lot because of Avraham (Bereshit 19:29), maybe because Lot was righteous as Avraham pleaded with HaShem to save (18:25) the righteous (even the whole city of Tzo'ar seem to be saved because Lot on his turn pleaded for it).
So was Lot righteous? Or were He and the city which he chose to flea to - Tzo'ar - saved only because of Avraham? And why so?