The Hoftstadter/Dennett book The Mind's I from 1981 is relevant in another way: the introduction jumps you into this exact scenario of finding yourself on Mars via a "Teleclone Mark IV Transporter" and getting beamed back before your instance on Mars dies, and raising these questions about identity. https://themindi.blogspot.com/2007/02/introduction.html