S.H.
I am guessing it is a case of people she knows in a new setting. My 5-yo daughter does the same thing. She sees her teacher daily, but if we see her outside the classroom setting, she hides behind me and won't acknowledge her presence. The same went for kids in her class. She is improving as she gets older, and will now wave at her teacher from last year instead of shutting down and pretending the teacher is invisible. Don't push, it makes it worse. Make the connection--"Oh, that's nice that your friends from home are in your school." Sometimes it helps them see that people can exist somewhere besides where they are used to seeing them. For other people and her selective sociality, it can be based on a lot of things including her mood and physical comfort--tired, hungry, busy, happy, etc. Also on whether she inherently feels comfortable with them. My DD does the same thing. She was much worse and wouldn't even acknowledge family when she was younger. She had therapy for social anxiety, but she had issues in the classroom too (lack of participation, speech, she wouldn't do anything, basically). If you are that concerned, talk to the teacher and see who is in charge of evaluating for social anxiety issues. It's usually free and better earlier than later, and better safe than sorry. They may say she's well within her range for her age and to try X, Y, and Z, or she may qualify for some therapy to help her cope with the anxiety. Good luck!