How can the Hellfire be under the Earth? Islam teaches that Hellfire will never come to an end. The Earth will come to an end so if the Earth will come to an end than how can the Hellfire exist forever?
First of all, I do not understand from where did you even come to know that the hellfire / Jahannam is under the earth. Do give any references if I am wrong because as much as I know and what I have read, I have never read or even heard of such a concept.
"The companions of the Fire will call to the Companions of the Garden: ‘Pour down to us water or anything that God doth provide". - Quran 7:50
As per my understandings of the above Ayat, it seems that Heaven and Hell both are not on the earth but instead somewhere else not disclosed to us yet. As per the Ayat, Hell is somewhere below Heaven and obviously, Heaven is not on the earth.