"왜 내가 집을 지어야 하는 거지?" == 왜 내가 집을 지어야 하는 것이지? => Why is it that I have to build a house?
* verb + (어/아)야: connective phrase expressing a required/expected condition.
- 사람은 먹어야(만) 산다: Human beings must eat to live. ("만" adds emphasis)
- 고생을 해 봐야(만) 인생을 안다: One must experience a hardship to know life.
* verb + (어/아)야 + 한다: 한다 (also 된다) here means "it will do", so the whole phrase just means "One must ... ".
- 나는 가야(만) 해 == 난 가야 돼: I must go. ("해" is not adding much, other than completing it with "it is required").
- 떠나야 할[하는] 그 사람: he who has to go.
- 너는 열심히 공부해야 해 [돼]: You must study hard.
- 너를 잊어야 한다면: if I had to forget you.
* 거지 = 것이지: -지 is a sentence ending for stating something softly or making a suggestion.
- 이렇게 하면 되는 거야: You do it like this and it will work. (a clear, firm statement)
- 이렇게 하면 되는 거지: same, but softer in tone, like partly talking to oneself.
- 이제 그만 가지?: Shall we go now? (a different usage making a suggestion)
(so ~지 ending here may be like ~거야? or a question to oneself, which is not clear without the context)
Here's some structures similar to ~(어/아)야 but meaning different things:
- 나는 가도 돼: I can [I am allowed] to go. ("도": also, as well). "해" won't work here.
- 나는 가면 돼: I can go and that will be it ("면": if ...). "해" won't work.
- 나는 가면 안 돼: I must not go. "해" won't work.
- 나는 가고는 해: I go from time to time. "돼" won't work here.
All these conjugations and particles are what make Korean very expressive as well as difficult to learn: 가야(만), 가도, 가면, 가서는, 가고는, 가기는, 가기만, 가기까지는, 가면서도, 가지는, ...