The character of Dr. Relling in this masterful play seems to have two principal roles. Firstly, he is one of the very few characters in the play who seems able to see the world around him for what it really is, without being tainted by personal prejudice or illusion. This is why he recognises implicitly that Hjalmar's "life-lie" is so important to hm that it must be continued in order for his life to continue. He also identifies that the claims of Gregers that an "ideal" existence can be created is rubbish. He seems to have a psychological understanding of humans and the way in which, as he thinks, we all need our illusions and various fantasies in order to live a life of happiness.
In addition to this role, Relling also seems to serve as a kind of narrator on the behaviour of other characters and the way that Ibsen injects reason into this play. When, for example, he says that Hjalmar will swiftly get over the death of Hedvig, we see no reason to doubt him, as he is a character who we as an audience implicitly trust, as he understands the characters around him better than they understand themselves.