Praise be to Allah.
If a person feels self admiration after doing something good or fears that he may show off, he should ward that off and resist it by seeking refuge with Allah from it, and saying “Allahumma inni a’oodhu bika an ushrika bika wa ana a’lam, wa’staghfiruka lima laa a’lam (O Allah, I seek refuge with you from knowingly associating anything with You, and I seek Your forgiveness for that of which I am unaware)” – as was reported from the Prophet (peace and blessings of Allah be upon him).
These kind of feelings happen to everyone, but you have to try to be sincere towards Allah, seek His forgiveness, and remember that there is no strength and no power except with Allah; if it were not for the help of Allah, you would not have been able to do this good deed, so to Allah be praise in the beginning and at the end.
The Prophet (peace and blessings of Allah be upon him) said to Mu’aadh ibn Jabal: “O Mu’aadh, by Allah indeed I love you, and I advise you, O Mu’aadh, do not forget at the end of every prayer to say: Allahumma a’inni ‘ala dhikrika wa shukrika wa husni ‘ibaaditika (O Allah, help me to remember You, give thanks to You and worship You in the best way).”
(Narrated by Ahmad, Abu Dawood, al-Nasaa’i, and others; it is saheeh).
Do not forego doing good deeds for fear of showing off, because this is one of the tricks that the Shaytaan uses to weaken people’s resolve and stop them from doing things that Allah loves and is pleased with.
As for merely feeling happy that one has done a good deed, this does not contradict sincerity and faith, for Allah says (interpretation of the meaning):
“Say: “In the Bounty of Allâh, and in His Mercy (i.e. Islâm and the Qur’ân); therein let them rejoice.” That is better than what (the wealth) they amass” [Yoonus 10:58] – meaning, if he attains guidance, faith and righteous deeds, and the mercy resulting from that overwhelms him and he feels joy and success as a result. Hence Allah commanded us to rejoice over such things.
The Prophet (peace and blessings of Allah be upon him) said: “If your good deeds make you happy and your bad deeds make you sad, then you are a believer.”
(Narrated by Ahmad, Ibn Majaah and others from the hadeeth of Abu Umaamah; it is a saheeh hadeeth).
By the same token, if people praise you for your good deed, then this is a portion of the glad tidings of the Hereafter, which Allah gives a person in this world. The Messenger of Allah (peace and blessings of Allah be upon him) was asked, “What do you think if a man does a good deed and the people praise him for it?” He said: “That is the portion of the glad tidings for the believer which he is given in this world.”
(Narrated by Muslim from the hadeeth of Abu Hurayrah, may Allah be pleased with him).
So this praise is a sign that Allah is pleased with him and loves him, so He makes him dear to other people.
We ask Allah to make our intentions and deeds right.