When Sherlock was to identify the dead body of Irene Adler in "A Scandal in Belgravia", did he really think it's hers or did he pretend to fool everyone else as he suspected Irene did that on purpose?
All the indications are that Sherlock truly believed she was dead.
Certainly he acts like he believes it..John says...
JOHN: He’s writing sad music; doesn’t eat; barely talks – only to correct the television.
(He walks further into the room and finally a figure begins to step out of the shadows at the other end.)
JOHN: I’d say he was heartbroken but, er, well, he’s Sherlock.
All the evidence would seem to confirm it...including DNA which was faked.
We see Sherlock receive the text from Irene and leave the abandoned building and in the very next scene clearly shows him as disoriented and somewhat lost in thought.
In short, there is NO evidence that Sherlock knew Irene was alive until she texted him to say so and it seems to have knocked him for a loop to find out.