I have heard about al-khadir. Can you tell me who he is and what is his task here?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Ibn Katheer wrote in his book Al-Bidaaya wan-Nihaaya (The Beginning and the End): “The way the al-Khadir's story was narrated implies that he was a Prophet. Here are some of the hints that prove this. Firstly, Allah Says (what means): {And they found a servant from among Our servants to whom we had given mercy from us and had taught him from Us a [certain] knowledge.} [Quran 18:65]
Secondly, Moosa (Moses) said to him (Al-Khidr): {May I follow you on [the condition] that you teach me from what you have been taught of sound judgement?}. [Quran 18:66]
If Al-Khadir were not a Prophet, Moosa would not have addressed him like this and he would not have replied to Moosa in the way he did. Indeed, Moosa asked for Al-Khadir's company to learn from the knowledge that Allah had distinguished him with, which Moosa did not know. So, if Al-Khadir were not a Prophet, he would not have been infallible and Moosa who is undoubtedly a Prophet and thus infallible, would not have had this desire to learn and to search for knowledge of a wali (pious man) who is not infallible.
Thirdly, Al-Khadir killed a child, had he not received a revelation from Allah, he would not have done such an act. This is a clear and separate evidence for his Prophecy and a proof for his infallibility.
Fourthly, after Al-Khadir explained clearly to Moosa the meaning of the deeds that he had performed, he added (what means): {…as a mercy from your Lord. And I did it not of my own accord.} [Quran 18:82]
This means, “I did not do them of my own initiative. I was ordered to do them by revelation.”
These are proofs that Al-Khadir was a Prophet. So, this sound evidence that Al-Khadir was a prophet, closes the door in front of those who said that he was a wali and that the Awliyah might come to know the crux of some things that the Messengers of Allah, may Allaah exalt their mention, themselves do not know.” [Abridged – Ibn Katheer]
For more benefit on Al-Khidr, please refer to Fataawa 87455 and 81886.
Allah knows best.
You can search for fatwa through many choices