Neither; you need to invert the subject and the verb after a question word; so, if the present perfect was the right tense (which it's not) you would say 'Why have you...'.
But I presume you're talking about a particular event; so the question would be 'Why did you do...?'
However, "so" is the wrong word here. You'd say 'Why did you do that?' or 'Why did you act/behave like that?'
If you're not referring to a particular event, you might want to use the present perfect continuous - 'Why have you been acting like that?', or you could specify a sort of behaviour: 'Why have you been acting strange [for the last couple of weeks]?