I believe the answer is: social facilitation
social facilitation refers to the tendency to act differently when we're around other people compared to when we think we're alone.
This type of behavior is being done in order to maintain a certain level of positive opinion that others would have for us.