his sense of confused urgency in that last shot leads me to believe that he was immediately planning on exposing Olivia Williams' character.
It would have been helpful with that not to tip off the woman at the center of a ludicrously complicated conspiracy that he was about to expose her, even though there was absolutely no reason for him to do so, and had he not done so he could have gotten away with it.
It's well-shot cinematically, no doubt, but it's so incredibly stupid that it just knocked the movie down from the A to the B-range for me.
I think at that point in the film he did that more to spite her than anything. You could almost say that she pulled the wool over his eyes during the entire film.
The Ghost character spends an awful lot of time suspecting Lang and his counterparts and near the end of the film you feel sympathetic toward him. I'm sure the Ghost character did as well. I mean, Lang's wife (Olivia Williams) practically manipulates the Ghost character throughout the entire story. Not only that, but she manipulated her husband which led to his death.
I'm sure the letter that he gives her was more of a way for him to tell her to piss her more than anything. Like I mentioned before, I'm sure he knew once he told her he would be in deep shit, which is why he looked so concerned during that last shot, but I don't think he realized just how deep shit he was in. Which makes me believe that the Ghost character slipping her the letter was completely intentional on the filmmakers' part and part of the general idea. It was meant to showcase just how inept he was (because let's face it, while he was a decently intelligent character, a little bit of suspension of disbelief and stupidity is required in order for all of this to make any sort of coherent sense).
One of the great things about the film is that the Ghost character was sort of thrown into the entire situation without any foreknowledge or any clue just what he was getting himself into. It was the classic "paranoid outsider" character/situation that Polanski has perfected over his career. Even at the end of the story, he was still
way over his head, even after knowing "everything", and to me that was just one of the more brilliant strokes in an already brilliant film and added emphasis to that particular story element in my opinion.