We Can Remember It For You Wholesale by Philip K. Dick

In this science fiction story, a man named Douglas Quail dreams of visiting Mars and decides to have false memories of a trip implanted by a company specializing in such services. However, during the procedure, technicians discover that Quail's memories have already been tampered with, revealing his past as a secret agent. As Quail grapples with the revelation of his true identity, he becomes entangled in a complex web of espionage and existential uncertainty, ultimately questioning the nature of reality and memory.