All I remember about the movie is that a man in a hotel in Africa (I think) takes the identity of a man that he finds dead next door. The man doesn't realize that people are looking for the man whose identity he stole. In the last scene the man is lying dead in a hotel bed. The camera then zooms out of the room and out of the building...
I believe you're referring to "The Passenger"(IMDB) from 1975 starring Jack Nicholson.