Somebody Among the Enemy Likes Me
The Expendable Spy of the title is an American agent parachuted into Bavaria late in World War II. When his contact is killed by an air raid, he assumes the man's identity, but then finds the contact was a Gestapo agent sent from Berlin to help organize the "Werwolf" underground (Nazis resisting Allied occupation). Worse, his new "boss" gets suspicious and asks Gestapo HQ for confirmation that this is the hotshot they sent. Unnervingly, the response is not only, "Yes, that's him," but includes a photo. Of the American agent. So he wonders WHO in Gestapo Headquarters in Berlin is on his side.
Clever and often humorous -- "What is it, man? Can't you see I'm busy shooting people?" -- but can be grimly cynical as well, for instance when the hero's superior in U.S. Army intelligence orders him murdered because he might accidentally compromise an operation ... and his mysterious "friend" in the Gestapo is the one who countermands that order.