Hudhayfa al-Mar’ashi  said: “Sincerity is the worshiper’s actions being identical in what is manifest and what is hidden.” 
Reflection: The quote reminds us that one has not achieved true sincerity, until the actions we do in private is identical to the actions we do amongst people. This is because our lack of actions in private, as compared to our actions in public, is a sign that we might seek the appreciation of people more than we seek the appreciation of the One who created them. As one scholar mentioned, it could be something as basic as praying less cycles of prayer (at a specific time) when we are at home, as compared to when we are among people. Depending on the circumstances, this could be a sign of insincerity of which the Prophet (ﷺ) warned in a hadith:
“When Allah gathers together the first and the last on the Day about which there is no doubt, a crier will call out, ‘Whoever associated a partner in an action which he did for Allah then let him seek his reward from other than Allah because of all partners, Allah is the One Who has least need of the association of partners.” 
Despite this warning, we might deceive ourselves into thinking that we have sincerity in our actions, but what if we truly stop and ponder? Can we say for sure that we only had Allah in our intention? Perhaps we could, but what about our intention during the course of the action? We might’ve started out with a sound intention, but as the action progressed it became corrupted by riya’, by insincerity. Maybe we started reading the Qur’an for the sake of Allah, but raised and beautified our voice as people were walking by. Perhaps we started giving a talk for the sake of Allah, but as we saw the admiration in the eyes of the people our intention changed.
Keep in mind that one of the great early scholars of Islam, Sufyan ath-Thawri, a companion of Hudhayfa al-Mar’ashi, said:
“I did not deal with anything more difficult than my intention, for indeed it turns on me.” 
In other words, one moment our intention might be sound and the next it might be stained by the hopes of fame and admiration. This change might happen in an instant without us even realizing it. For this reason it’s important to be mindful of one’s intention before the performance of an action and up until it’s completion. It has been reported that the Prophet (ﷺ) said:
“The believers intention is better than his action.” 
One of the meanings of this hadith is that the intention is worthy of reward, as it is made for the sake of Allah and hidden from people. But once the action is performed, it is exposed to the looks of men and insincerity might start to creep in. This shows the importance of being mindful of one’s intention during the course of the action!
One last point to keep in mind: Even though we feel more encouraged to do good among people, this isn’t necessarily a sign of insincerity. We are social beings and we naturally get affected by our surroundings to do specific things. This is the very reason why it’s important to seek out good company, as our friends might encourage us to do good deeds and stay away from sin. However, we must always remember why we do the things we do. As long as we keep Allah in mind, as we do the actions in their company, this is sufficient inshaAllah and any feelings or thoughts that we might be insincere should be put aside.
Another way to test our sincerity among people, as mentioned by the scholars, is to do the good deeds in their company, but in a way that makes them unaware that we are doing it. Perhaps we make dhikr in silence while sitting among friends or pray supererogatory prayers in the back of the masjid while others are praying in the front. If we still feel just as encouraged to do the good deeds then this a sign of sincerity.
Many more things can be said about intention, but this suffices for the post inshaAllah.
May Allah make our intentions sincere for His sake alone.
 According to ad-Dhahabi he was one of the saints who lived at the time of Sufyan ath-Thawri and narrated from him (Siyar A’lam al-Nubala, ad-Dhahabi)
 Imam an-Nawawi, Tibyaan fi adaabi hamalat al-Qur’an (Quote taken from the English translation: “Etiquette With The Qur’an”, Musa Furber)
 Imam Ahmad, at-Tirmidhi and Ibn Majah narrated it.
 Ibn Rajab, Jami’ al-Ulum wa al-Hikam (English translation: “The Compendium of Knowledge and Wisdom”, translated by Abdassamad Clarke)
 This hadith has been narrated by numerous chains. Most of them have weakness in them, but combined together they make it suitable to quote as a hadith (see: https://hadithanswers.com/the-intention-of-a-believer-is-better-than-his-action/ for references)