Emmanuel Carrère didn't just write the screenplay, he wrote the original novella
La Moustache in the mid 80s, before deciding to make a film about it. It's been a while since I caught at the Rendez-vous with French Cinema
screening, but I believe he said something about trying to find someone who would make the film before deciding that he was probably the best candidate to realize it. The novel is actually quite darker compared to the film. Anyway, here's a transcript of why he changed it (I think it really nails the spirit of the film):
Q: Did the change in ending between the book and the film come at a late date?
A: No, it was the basic premise of the adaptation, as soon as I started talking about it with Anne-Dominique Toussaint. The ending in the book is not only desperate but physically unbearable and I didn't want to return to that. Technically, I didn't see how it could be shot and, above all, despair no longer interested me. It's probably a question of age, with almost twenty years between me and the book now: I have grown softer. Rather than the story of a man who sinks into a whirlpool of madness, I preferred to show how a man and a woman who love one another can grow apart, travel a long way from each other and, in the end, find each other differently than at the beginning. They were in a state of fusion and end up making room for each other. It's harder, it means admitting we're alone but, in my opinion, it's better.