Warnings against Riya (showoff) in Quran and Hadith:
Allah (swt) warns in His holy book that
"Woe to those performers of Salah , who are neglectful of their Salah and who (do good only to) show off" (Surah Al Ma'un)
Further Allah says (from a Hadith Qudsi)
"I am so self-sufficient that I am in no need of having partners. Thus whoever does an action for someone else's sake as well as Mine, will have that action rejected by Me to him whom he associated with Me." (Muslim)
Umar (RA) once went out to Masjidul Nabawi and found Muadh bin Jabal (RA) sitting and crying at the grave of the prophet (saws). Umar (RA) asked him "Whay are you crying ?". He replied "Something which I have heard from Messenger of Allah(saws). He (Prophet) said: ' A little ostentation (doing good deeds for show off) is polytheism (shirk). The person who shows enmity towards a friend of Allah has in fact challenged Allah to a fight. Allah loves those who are obedient, pious and anonymous - they are not missed when they are absent, they are neither summoned nor recognized when they are present. Their hearts are lamps of guidance. They come out of every dark whirlwind (by virtue of their illuminated hearts)" (Ibn Majah)
Abu Hurayrah (RA) said, "I heard Allaah's Messenger (saw) say: "The first of people against whom judgement will be pronounced on the Day of Resurrection will be a man who died a martyr. He will be brought and Allaah will make known to him His favours and he will recognise them. Allah will say: "And what did you do about them?" He will say "I fought for you until I died as a martyr". He will say, "You have lied - you did but fight that it might be said: "He is courageous". And so it was said." Then he will be ordered to be dragged along his face until he is cast into the Hellfire. [Another] will be a man who has studied [religious] knowledge and has taught it and who used to recite the Qur'aan. He will be brought and Allaah will make known to him His favours and he will recognise them. Allaah will say: "And what did you do about them?" He will say, "I studied [religious] knowledge and I taught it and I recited the Qur'aan for Your sake". He will say, "You have lied - you did but study [religious] knowledge that it might be said [of you]: "He is learned". And you recited the Qur'aan that it might be said [of you]: "He is a reciter". And so it was said". Then he will be ordered to be dragged along on his face until he is cast into Hellfire. [Another] will be a man whom Allaah had made rich and to whom He had given all kinds of wealth. He will be brought and Allaah will make known to him His favours and he will recognise them. Allaah will say: "And what did you do about them?" He will say, "I left no path [untrodden] in which You like money to be spent without that it might be said [of you]: "He is open-handed". And so it was said." Then he will be ordered to be dragged along on his face until he is cast into Hellfire." (Muslim).
May Allah (swt) give us the tawfiq to safeguard ourselves from wasting this short life we have by doing deeds for show off and worldly glory.
Doing deeds only for the pleasure of Allah (swt)
Allah's Messenger (saws) states that
"Allah neither looks at your bodies nor at your wealth. Rather he looks at your hearts and your deeds" (Muslim)
Allah's Messenger (saws) narrates the incident of a person who wanted to do charity with Ikhlaas and with anonymity. "“A man (from amongst the people before you) said: ‘Indeed! I will give in charity.’ So he took his Sadaqah out and (unknowingly) placed it in the hand of a thief. In the morning people talked (about this incident) and said: ‘Sadaqah was given to a thief last night.’ The man said: ‘O Allah! Praise be to You. I have given Sadaqah to a thief. Indeed, I will give in charity!’ So he took his Sadaqah out and he placed it (unknowingly) in a prostitute's hand. In the morning people talked (about this incident) and said: ‘Sadaqah was given to a prostitute last night.’ On hearing this, the man said: ‘Praise be to You, O Allah! I gave Sadaqah to a prostitute. Indeed, I will give in charity!’ So he took his Sadaqah out and placed it in a rich man's hand. In the morning people talked (about this incident) and said: ‘Sadaqah was given to a rich man last night.’ The man said: ‘O Allah! Praise be to You (for helping me) give charity to a thief, a prostitute and a rich man.’ Then he had a dream in which he was told that his Sadaqah to the thief might result in his refraining from his theft, his Sadaqah to the prostitute might help her abstain from her immorality, and his Sadaqah to the rich man might help him pay heed and spend from what Allah had bestowed upon him.” [Sahih Bukhari]
Developing Ikhlaas
Realizing that no one other than Allah (swt) can truly cause us any benefit or truly protect us from any difficulty is important to develop Ikhlaas. According to a Hadith,
Whoever sought the pleasure of Allah though it was displeasing to the people then Allah becomes pleased with him, and will make the people please with him, and whoever sought the pleasure of the people though it was displeasing to Allah then Allah becomes displeased with him and will make the people displeased with him (Ibn Hibban/ Tirmidhi)
Surely doing any act of ibadat (charity, prayer, fasting etc) to please people or for fame is displaeasing to Allah (swt). May Allah (swt) make us among those whom He is well pleased with and by virtue of which He makes all the Creation pleased with us.