I watched this Japanese movie several years ago but can't remember the film name. Hope someone can help?

The story is about this doctor from an affluent family. He has a gentle and beautiful wife too, so all was going well for him. But his life started changing when someone who looks similar to him started haunting him and he discovered that his wife was not who he thought she was. Their relationship became strained when he refused to treat people from the slums and his doppelganger revealed that his wife was from the slums.

Later on in the story, the doctor attacked his doppelganger out of frustration and one of the them landed in a well... trapped there always, while the other returned to the affluent life in a cold relationship with the wife.

Does this ring any bells?