Why would she act weird and get me in trouble?

Something is up with this girl I’ve been hanging out with/talking to a lot with and now she’s been weird around me. I notice she’s not talking to me much anymore and talking to everyone else fine like usual. I ask her if something is bothering her and if I have done anything to her I apologise which she denies. But then the next day she ignores me but tries to get me jealous on the same day. This is messing with my head, so I decided to get to the bottom of it and confront her. Which scared her but I was trying to communicate with her to know how she is feeling? She ended getting me in trouble and said something that upset me. She’s been hiding from me but still staring at me over the last few days and now is easing in to trying to talk to me again. Is she mad with me at something but denying it? Or is she playing hard to get? Because I have no idea. I doubt she likes me if she got me in trouble but I don’t get it
Why would she act weird and get me in trouble?
Post Opinion