All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His Slave and Messenger.
What those people said to you is not true. A Muslim is enjoined to call people to goodness and good doing and warn them about committing evil, and this is one of the greatest and most rewardable righteous deeds that draw the one doing them closer to Allaah. This is why Allaah, The Exalted, says (what means): {And who is better in speech than one who invites to Allaah and does righteousness and says, "Indeed, I am of the Muslims."} [Quran 41:33] The Prophet said, "By Allaah, if Allaah guides even one person through you, then that is better for you than possessing a whole lot of red camels (the most expensive camels)." [Al-Bukhari and Muslim]
He also said, "He who guides (others) to an act of goodness will have a reward similar to that of its doer," and, "Whoever calls to guidance, then he receives the reward similar to the reward of whoever follows him without that diminishing anything from their rewards." [Muslim]
The fact that your family and relatives are lax in their religious commitment is not an excuse for you to give up calling people to Allaah, and you are not to be blamed for it. Many of the Messengers and callers to Allaah had some family members who did not respond to their calls and did not believe in them. Prophet Nooh (Noah) called his people for 950 years, yet his own son and wife did not believe in him and died as disbelievers. Allaah, The Exalted, says (what means): {And Nooh called to his Lord and said, "My Lord, indeed my son is of my family; and indeed, Your promise is true; and You are the most just of judges!" He said, "O Nooh, indeed he is not of your family; indeed, he is [one whose] work was other than righteous...} [Quran 11:45-46]
Allaah, The Exalted, said about the wife of Prophet Nooh (Noah) and the wife of Prophet Loot (Lot) (what means): {Allaah presents an example of those who disbelieved: the wife of Noah and the wife of Lot. They were under two of Our righteous servants but betrayed them, so those prophets did not avail them from Allaah at all, and it was said, "Enter the Fire with those who enter."} [Quran 66:10]
It is well-known that those Prophets of Allaah were never discouraged by the disbelief of their family members, and this was never a source of frustration for them.
There is no doubt that the Messengers of Allaah are the best role models for the callers to Allaah. Therefore, you are advised to carry on calling your family to Allaah with patience and to implore Him to bless them with guidance. You are also advised to continue calling people to Allaah, reminding yourself that by doing so you are honoring the legacy of the Prophet that should be preserved by his heirs (the callers to Allaah). He was a source of mercy and guidance to the worlds, calling his close family members and relatives to Allaah as well as the broader community in Makkah and the whole world. Allaah, The Exalted, says (what means):
• {And We have not sent you [O Muhammad] except as a mercy to the worlds.} [Quran 21:107]
• {Blessed is He Who sent down the Criterion upon His Servant that he may be to the worlds a warner.} [Quran 25:1]
• {And thus We have revealed to you an Arabic Quran that you may warn the Mother of Cities [Makkah] and those around it and warn of the Day of Assembly, about which there is no doubt. A party will be in Paradise and a party in the Blaze.} [Quran 42:7]
Please refer to fataawa 16844, 53349, and 87573 on the guidelines for calling one's family and relatives to adhere to the Islamic teachings and the sharee'ah.
Allaah Knows best.