Simulacron-3
Simulacron-3 by Daniel F. Galouye (1964) — see its film and TV adaptations.