na-adjective
Describes someone as mentally unstable or acting irrationally. Often used in a colloquial, somewhat strong way. The phrase is a set expression meaning 'one's mind is strange'.
あんなことを言うなんて、彼は気が変なんじゃないか。
Saying something like that, he must be crazy.
気が変になりそうだ。
I feel like I'm going insane.