In the Qur'an, God commands man to live by the principles of the religion voluntarily and devoutly:
... It is even better for anyone who can volunteer some wealth. But that you should fast is better for you, if you only knew. (Surat al-Baqara: 184)
Safeguard strictly your (habit of) prayers- especially the middle one; and stand up devoutly to (worship) God. (Surat al-Baqara: 238)
Abraham (Ibrahim) was a community in himself, exemplary, devoutly obeying God's will, a man of pure natural belief and he joined not deities with God. (Surat an-Nahl: 120)
In the Qur'an, God draws our attention to the existence of some people who perform prayers or who give away their wealth only to show off. However, as seen in the verses above, while performing one's prayers, fasting, giving alms or showing obedience, what really matters is one's real intention and heartfelt thoughts. It may well be that these people do not reflect on God, and consider their feebleness and submissiveness before God while praying, but only perform the rituals. Alternatively, one may do charity works, may found schools or help the poor. However, unless done for the sole purpose of earning the good pleasure of God, reflecting on the fact that one is weak and in need before God and feeling fear of the hereafter, these acts may not be acceptable by God. God tells us that the blood of the sacrificial animals does not reach Him, but the fear of Allah (taqwa) is what reaches Him:
Their flesh and blood does not reach God but your devotion (taqwa) reaches Him. In this way He has subjected them to you so that you might proclaim God's greatness for the way that He has guided you. Give good news to the good-doers. (Surat al-Hajj: 37)
Among the major erroneous beliefs is that people assume they will be held responsible only for their actions. Yet, God informs us that man will account for his intentions, thoughts and even what he conceals deep in his heart.
Everything in the heavens and everything in the earth belongs to God. Whether you divulge what is in yourselves or keep it hidden, God will still call you to account for it. He forgives whomever He wills and He punishes whomever He wills. God has power over all things. (Surat al-Baqara: 284)
God has knowledge of one's heart, subconscious, thoughts and what he keeps hidden from others. God intervenes between a man and his heart. Therefore, man cannot possibly keep anything hidden from God. Any doubt that crosses his mind, any whispering of Satan, his actual thoughts about believers, his faith in the Qur'an, what crosses his mind while performing the prayers are all known one by one by God and recorded by angels. For example, God knows when one performs prayers lethargically, or when he harbours contradictory thoughts. Man will meet each one of these on the Last Day. Purifying one's heart, living by the religion, not by observing the rituals only but also by being sincere and committed, are the ways we will attain salvation. It would simply be imprudence to neglect the eternal and real life of the hereafter for a brief and fleeting life. Below are some verses in which God warns mankind about the temporary nature of the life of the world:
My people! The life of the world is only fleeting enjoyment. It is the Hereafter, which is the abode of permanence. (Surah Ghafir: 39)
These people love this fleeting world and have put the thought of a Momentous Day behind their backs. (Surat al-Insan: 27)