어이로 갈 것인가이다 is a predicative form capturing a question like a noun clause, similar to "(it) is where to go" or "(it) is where we should go".
- (문제는) 어디로 갈 것인가이다 = 어디로 갈 것인가? + 이다 (particle for "(it) is") = (The question) is where to go.
You can treat a question phrase like a noun clause and add particles to it like 은/는, 이/가, 이다, etc.
The -지 ending is also used sometimes in place of the raw ending -ㄹ까, -ㄴ가, -냐, and others.
- 누가 더 잘하는가는/잘하는지는 겨뤄 봐야 안다 = The way to find out who's better is by an actual contest.
- 문제는 고양이 목에 누가 방울을 달 것이냐였다 = The question was who should tie a bell to the neck of the cat.
- 죽느냐 사느냐, 그것이 문제로다 = 죽느냐 사느냐가 문제로다 = To be or not to be, that is the question = The question is whether to be or not to be.
휴가 장소를 선택할 때 가장 많이 하는 고민은 산과 바다 중 어디로 갈 것인가이다.
=> The most common decision we are faced with when picking a vacation destination is between the mountain and the sea.