In the chapter 38, Section 3 of Satarudra-Samhita of Shiva Purana, the story of the description of Arjuna’s penance is mentioned.
To win over Kuravas, Arjuna went over impassable mountains for the practice of his steady rites. He met a Yaksha on the way and through him he slew many robbers. He was delighted in his mind and reached the excellent mountain. Near Ganga he saw a beautiful spot with Ashoka groves. It was excellent like the heaven. He halted there, took his bath and bowed to his venerable preceptor. He assumed dress and features according to his instructions. He curbed his sense organs and the mind and stood steady.
He made a clay idol of Shiva even and beautiful. In front of it he stood in meditation on the excellent heap of splendour. He took baths thrice a day. He performed various sorts of worship. He performed the Upasti form of worship of Shiva again and again.
Indra’s spies saw the splendour-column coming out of his head. They were frightened by it. They thought within themselves—“When did he come in? Indra must be informed.” Indra’s spies said:--
“O lord of gods, we do not know who it is. Some one is performing a penance in the forest, a god, a sage, the sun or the fire. We are scorched by his splendour and have come near you. We have told you the details. Please do what is proper.”
Thus informed by the spies, Indra, the enemy of mountains, understood whatever his son Arjuna desired to do. He dismissed them and decided to go there to test him. Indra assumed the form of an elderly Brahmin bachelor and went there to test him.
On seeing him come, Arjuna worshipped him. After eulogising him he stood in front of him and said—“Whence do you come now? Please tell me”
The lord of gods thus requested by him spoke with a hint at testing his courage, out of love. The Brahmin said:--
“O dear, why do you perform the penance in your prime of youth? Is it for salvation or for victory? In every respect this penance of yours is useless.”
Thus questioned by him he informed him of everything. The Brahmin said:--
“This is not proper on your part to pursue this penance for achieving happiness or for salvation by means of Ksatraic rites, O excellent scion of the Kurus. Indra is the bestower of happiness and not of salvation. O excellent one, it behoves you therefore to perform a more excellent penance.”
On hearing his words Arjuna was angry. Slighting it but humbly, Arjuna of good rites replied. Arjuna said:--
“It is neither for kingdom nor for salvation that this penance is resorted to. Why do you speak like this? I am performing this penance on the advice of Vyasa. O bachelor, go hence. Do you wish to cause my downfall? Of what use is this to you a bachelor?”
On being addressed thus he was delighted. He revealed his wonderfully beautiful form with all paraphernalia to him. On seeing the form of Indra, Arjuna was ashamed. Indra spoke to him again after consoling him. Indra said:--
“O dear, O Arjuna of great intellect, choose your boon, whatever you wish in your mind. There is nothing which cannot be given to you.”
On hearing the words of Indra, Arjuna replied “O father, bless me with victory. I am afflicted by enemies in every respect.”
“Your enemies, Duryodhana and others are very powerful. Droṇa, Bhisma, Karna and others are certainly invincible. Ashvatthaman, son of Droṇa and a part of Rudra, is extremely invincible. But they can be withstood through me. Listen to what is wholesome to you. O hero, none is capable of performing this Japa. Shiva is the greatest of all. Hence perform the Japa of Shiva now. Shiva is the lord of worlds, the mobile and immobile beings. He is the lord of heaven. He can do everything. He is the bestower of worldly pleasures and salvation. I, Brahma and others, Vishnu the bestower of boons and those who crave for victory are the devotees of Shiva. Now onwards leave that mantra and worship Shiva with devotion through the rules laid down for the worship of his day phallic image and by contemplating on him. O Bharata, by your devotional feelings and modes of service, you worship Shiva. Your achievement will be unshakable. No doubt need be entertained in this respect.”
After saying this he called out his spies and said—“All of you shall be cautious and attentive in protecting him always.”
Thus alerting his spies for the protection to be accorded to Arjuna, Indra spoke again to Arjuna with his heart full of fondness and affection.
“O Gentle one, O terrifier of enemies, you shall not commit blunders in the administration of your kingdom. This mantra will be conducive to your glory. Always courage shall be maintained by an aspirant. Shiva the protector will give you riches and the fruits of your desire. This is undoubtedly true.”
After giving the boon to Arjuna, the lord of gods remembered the lotus-like feet of Shiva and went to his abode. The heroic Arjuna bowing to the lord of gods performed the penance with controlled mind with Shiva as his goal.