If you’re lucky enough to become rich you should avoid excessive materialism, flaunting your wealth & surrounding yourself with money focused individuals. It's important to prioritise financial responsibility, seek genuine relationships & make informed investment decisions. You should avoid neglecting your personal well being & prioritise mental & physical health. By avoiding these pitfalls you can maintain a balanced & fulfilling life as a wealthy person.
That is actually the most common way most individuals from rags to riches do. I can even see people posting something they achieved in life on social media and I personally do not have any problem with that because it's their life not mine but yeah it all comes with risks we all know that.
Most people who normally post there success on the social media always fail to realize the risk it will bring to there life because on a normal they will feel that they are actually helping or motivating people on the things he go through before arriving were he is and there is nothing wrong with it but in other words he is actually telling people how wealthy and rich he is and possibly he could endanger himself by doing that, though is mostly common for those people who started with nothing and become rich later.
I think there is nothing wrong with what they do by posting their success or success on social media where there are likely to be many people who see it, because after all what is shown can motivate others or raise the spirits of others who may at that time there are people who are experiencing failure and downturn. And for me the risk that will be felt by people who show their success is nothing more than social risk, or the point is that maybe in the next few days or months there will be many people who come like asking for help such as borrowing money or wanting to ask for directions or ways to be successful like him, and for that problem I think it is not a risk, because after all the name risk is when someone does something that tends to lead to mistakes that can threaten or endanger him such as taking a decision or doing something excessively, but if not then I think posting success on social media is a common thing that many people often do.
I don't know what the lifestyle is like in your country, but in my country, poor people can hang out with rich people, but rich people will rarely work with poor people, and most rich people usually just cooperate and do business with rich people. Therefore, whether someone brags about their success or wants to prove that they have become rich has its own purpose. Some may want to assert themselves as talented people and want to set themselves as an example for others to make efforts as you said. But there are also some people who do it because they are looking for ways to expand better relationships to increase wealth.
In addition, perhaps the security situation in each country is different, and I don't see any risk in someone wanting to brag on social networks when they become rich in my country.