How should one handle a flawed question in a textbook?
If at all possible, you should not assign questions that don't make sense. And if you are aware of textbook problems that don't make sense, then sure, warn your students about them (even if you don't assign the problem - students can still decide to work on the problem just because it's in the textbook and end up getting confused, wasting their time, and/or developing misconceptions about the material).
If you can fix the flawed problem by telling the students to change some of the problem parameters (for example changing the 1:3:5 ratios in your triangle example to something else that avoids the impossibility issue), that could certainly help your students as well. If you fix the problem, it's fine to assign the corrected version of course.
the exam is not set or graded by me
In that case, you should point out the issue to the person who does assign the problems. Surely they would see that it's a bad idea to assign such a problem without correcting it first.
If the person in charge refuses to correct the flawed problem or to not assign it, you will have joined the ranks of people around the world with unreasonable bosses who make bad decisions - a club that much of humanity belongs to. I suppose at that point you might decide to get subversive and explain the issue to your students directly. I hope that doesn't get you in any trouble (it wouldn't at my institution, but they also don't dictate to me what problems to assign, so I am a bit baffled by the situation you're describing).
how do I answer the question "what if this shows up in the exam"?
"I'll speak to [person in charge] to try to make sure it doesn't, but if it does, complain to [person in charge/committee in charge of correcting abusive grading practices/etc]."