The exact identity of the messenger is never revealed. One can surmise, though, that during these horrendous times, a period in which Macbeth has become an absolute tyrant, overwhelmed by evil and a lust for blood, a bit of good still prevails. Those who therefore have even a little knowledge of impending doom would warn others whose lives are in peril at great risk to themselves, as in this instance.
The fact that the messenger is unknown emphasises the depth of Macbeth's ruthlessness - everyone is affected: if you're not with Macbeth, you are against him and you will be persecuted.
We can gauge from the messenger's language that Lady Macduff is not familiar with him, but that he is fully aware of her position and status. He says:
I am not to you known,
Though in your state of honour I am perfect. (IV.ii)
The messenger is humble and kind, referring to himself as "homely". We can therefore conclude that he is not of very high rank or royalty, for Lady Macduff would have been familiar with him. He is kind-hearted enough to apologise to her for delivering such a frightening message, stating that to have done less would have been even worse. He passionately calls for heavenly protection over Lady Macduff and her children and, realising the danger to himself, states that he dare not tarry any longer.
The messenger is obviously loyal to Macduff and his family and might even be a soldier who has fought under his leadership or even someone in his employ. The fact that he delivers the warning so late suggests that he had probably only just recently learnt about the impending attack or had just seen Macbeth's assassins on their way to Macduff's castle.
Be that as it may, his admonition has come too late and this futile warning adds to the horrifically dramatic denouement of this scene.
Some critics suggest that Ross is the messenger, but this is impossible because at the opening of this scene (Act IV.ii) Ross has an intimate, entreating conversation with Lady Macduff wherein he confesses to his affection for her: "should I stay longer,/It would be my disgrace and your discomfort:...." Consequently it is impossible for Ross, whom she knows well, to be the Messenger who acknowledges that she does not know him at all: "I am not to you known."
We do not know the Messenger's identity but we can suppose that he is someone close enough to Macbeth to know what his plans are and who is morally good enough to warn the innocent Lady MacDuff, even though his warnings put him at risk and are not in time for her to act. In the brief speech he delivers and the brief time he is there no one calls him by name or identifies him in any manner. Because his warning is so quick, he escapes being included in the murder of Macduff's household. We don't know his identity.
The messenger is someone who knows that Lady Macduff is a person of high position or honor ("in your state of honor I am perfect") who delivers a desperate, though polite, warning. He says he is sorry for scaring Lady Macduff but he tells her that she should leave immediately. Apparently he is fearful for his own life because he also says, "I dare abide no longer," then immediately exits the scene. Other than that, his identity is not revealed.