Praise be to Allah.
With regard to what the questioner has mentioned, there is no proof to confirm it in the Holy Qur’an or in the saheeh Prophetic Sunnah. The most that has been narrated concerning it is reports from some of the Sahaabah and Taabi‘een.
It was narrated from Ibn ‘Abbaas (may Allah be pleased with him) that he said: The first thing that Allah created was the Pen, and it wrote all that is to happen. Then water vapour was raised, from which the heavens were created. Then the noon – i.e., the whale – was created, and the earth was spread out on the back of the noon, and the earth moved and shook. Then it was made steady with the mountains, and for that reason the mountains boast to the earth. And he recited (interpretation of the meaning): “Noon. (These letters (Noon, etc.) are one of the miracles of the Quran, and none but Allah (Alone) knows their meanings).By the pen and what the (angels) write (in the Records of men)” [al-Qalam 68:1].
This was narrated by ‘Abd al-Razzaaq in his Tafseer (2/307); Ibn Abi Shaybah (14/101); Ibn Abi Haatim – as mentioned in Tafseer Ibn Katheer (8/210); at-Tabari in Jaami‘ al-Bayaan (23/140); al-Haakim in al-Mustadrak (2/540); and many others. All of them narrated it via al-A‘mash, from Abu Zabyaan Husayn ibn Jundub, from Ibn ‘Abbaas. This is a saheeh isnaad. Al-Haakim said: This hadith is saheeh according to the conditions of the two shaykhs (al-Bukhaari and Muslim), although they did not narrate it. Adh-Dhahabi said in at-Talkhees [It is saheeh] according to the conditions of al-Bukhaari and Muslim, as was narrated from Mujaahid, Muqaatil, as-Suddi and al-Kalbi. See: ad-Durr al-Manthoor (8/240); Tafseer Ibn Katheer (8/185) at the beginning of the commentary on Soorat al-Qalam.
This report – as you can see – is mawqoof and is the words of Ibn ‘Abbaas. It is not the words of the Prophet (blessings and peace of Allah be upon him). What is most likely to be the case is that Ibn ‘Abbaas (may Allah be pleased with him) learned it from the words of Ka‘b al-Ahbaar or from the books of Bani Israa’eel that contain many weird and strange things and lies. This is indicated by the details mentioned in some of the books of tafseer concerning this matter.
Imam al-Baghawi (may Allah have mercy on him) said:
The narrators said: When Allah created the earth and split it (from the heavens), He sent from beneath the Throne an angel who came down to earth until he reached beneath the seven earths, then he placed them on his shoulders, with one of his hands in the east and the other in the west, stretched out and holding the seven earths until he managed to get them settled. His feet did not have a firm place to stand on, so Allah, may He be glorified and exalted, sent down from al-Firdaws a bull that had forty thousand horns and forty thousand feet, and He made the feet of the angel stand on its hump, but his feet did not become settled firmly on it. So Allah took a green emerald from the highest level of al-Firdaws, the thickness of which was the distance of five hundred years, and He placed it between the hump and the ear of the bull, so that the feet of the angel could stand firm on it. The horns of that bull emerge from beneath the layers of the earth, and its nostrils are in the sea. Every day it takes a breath. When it exhales, the tide comes in towards the land, and when it inhales, the tide goes out. The feet of the bull had no firm place to stand, so Allah, may He be exalted, created a rock as thick as seven heavens and seven earths, so that the feet of the bull could stand firm on it. This is the rock that Luqmaan mentioned to his son when he said: “O my son! If it be (anything) equal to the weight of a grain of mustard seed, and though it be in a rock, or in the heavens or in the earth, Allah will bring it forth” [Luqmaan 31:16]. The rock was not stable, so Allah created a noon, which is a great whale, and placed the rock on its back, and there is nothing else on its body. The whale is on an ocean, and the ocean is carried on the back of the wind, and the wind is carried by divine power. It was said that the entire world, with everything on it, is only two letters (the kaaf and noon of the word kun, meaning ‘Be!’); the Compeller, may He be glorified and exalted, said to it: ‘Be!’, and it was.
Ka‘b al-Ahbaar said:
Iblees managed to reach the whale on whose back the earth is carried and he whispered to it: Do you know what is on your back, O Leviathan – the name of the whale – of nations, animals, trees and mountains? If you shake them off, you will throw them off from your back. Leviathan thought of doing that, but Allah sent a beast that entered his nostrils and reached his brain, so the whale beseeched Allah because of it, and Allah gave it permission to leave.
Ka‘b said: By the One in Whose hand is my soul, the whale is looking at the beast and the beast is looking at the whale, in case the whale wants to do that, in which case the beast is ready to jump back into its nostrils. End quote.
Ma‘aalim at-Tanzeel (8/186). There is a similar report in Tafseer al-Qurtubi (29/442). The words of Ka‘b al-Ahbaar were narrated by Abu Nu‘aym in Hilyat al-Awliya’ (8/6), The commentators on Tafseer at-Qurtubi (1/385), both Dr ‘Abdullah ibn ‘Abd al-Muhsin at-Turki and Muhammad Ridwaan ‘Irqsoosi, commented on this report and said: It is an Israa’eeli report (i.e., from Jewish sources) for which there is no basis. It would have been better for the author to keep such things out of his book. End quote.
Look at how the narrators added more details to the story, then ultimately the matter can be traced back to Ka‘b al-Ahbaar, who was the source of many weird things that are attributed to this religion.
Therefore al-Haafiz Ibn Katheer pointed out in al-Bidaayah wa’n-Nihaayah (1/15) – after mentioning a number of weird reports, including this hadith – that it is one of the Israa’eeliyyaat (reports from Jewish sources) and said: In this report with this isnaad, as-Suddi mentions many weird things; it is as if many of them came from the Israa’eeliyyaat. End quote.
There are also some marfoo‘, munkar (odd) hadiths with similar meanings, including the report narrated from Ibn ‘Umar, according to which the Prophet (blessings and peace of Allah be upon him) said: “The earth is above the water, and the water is above a rock, and the rock is on the back of a whale whose flippers touch the Throne. The whale is on the shoulders of an angel whose feet are standing on nothing.” This is a mawdoo‘ (fabricated) hadith. See: as-Silsilah ad-Da‘eefah (no. 294).
As none of these reports was proven to be sound or regarded as part of religious teachings, and they are not mentioned in the Book of Allah or in the Sunnah of His Messenger (blessings and peace of Allah be upon him), the most that can be said concerning them is that they are reports from some of the early generations, and it is clear that the source of all of them is reports from Jewish sources. What we must do with regard to such reports is refrain from confirming any of them, and delegate knowledge of that to the Knower of the unseen, as the Messenger of Allah (blessings and peace of Allah be upon him) taught us. It was narrated that Abu Hurayrah (may Allah be pleased with him) said: The People of the Book used to read the Torah in Hebrew and explain it in Arabic to the Muslims. Therefore the Messenger of Allah (blessings and peace of Allah be upon him) said: “Do not believe the people of the Book and do not disbelieve them. ‘Say (O Muslims), "We believe in Allah and that which has been sent down to us and that which has been sent down to Ibrahim (Abraham), Ismail (Ishmael), Ishaq (Isaac), Ya‘qoob (Jacob), and to Al-Asbat (the twelve sons of Ya‘qoob (Jacob)), and that which has been given to Moosa (Moses) and ‘Eesa (Jesus), and that which has been given to the Prophets from their Lord. We make no distinction between any of them, and to Him we have submitted (in Islam)’ [al-Baqarah 2:136].”
According to another report, the reason for refraining from believing or disbelieving is explained as follows:
“Then if it is false you will not have believed it and if it is true you will not have disbelieved it.” Narrated by Abu Dawood (3644) and Ahmad (16774); classed as saheeh by al-Albaani in as-Saheehah (2800).
And Allah knows best.