Thanks for the question! So you’er not wrong in saying that you can infer X —> Z from the following statements, after all, we can take the contrapositive of the last statement and combine it with the first to get
X —> Y Y —> Z
Therefore, X —> Z. So that’s a great way to use those statements!
However, in this case, remember that we’re also told that Y exists. Given that we’re told the existence of a variable, we’re probably meant to determine the existence of another variable. I’m not actually sure what the official answer choice is here (can’t see the flashcard), but I’m assuming that we’re supposed to use Y and Y —> Z to conclude that Z exists. But your inference was correct, which is what counts. Remember, these are just kind of drills to make sure you know how to manipulate the logic, so it’s not a huge deal if you don’t get the “official” answer.
Hope this helps! Feel free to ask any other questions that you might have.