If a person makes a wrong turn into an Arab neighborhood (for example) and he is asked if he is a Jew, can he respond “no”? Based on Shulchan Aruch (YD 157:2) it would seem that he would not be able to say “no”, since saying you are a goy is yehreg v’al yaavor (although one can say a statement that can be interpreted in two ways). Can another Jew say that you are a goy— that would seem to be fine under the circumstances?
I agree with you that to say “No” would not be permitted since he is saying it and not that the gentile misinterpreted things, however if he can say it in a way that he gentile would misinterpret it, then it would be permitted . The sefer Revid Zahav pg. 17 (Biur Hamitzvos) brings a story from the Toras Chaim A”Z 17, that was asked by some gentiles if he s a Jew and he answered “Kain Yud”. In Yiddish or German it would be interpreted as Kain- (not) Yid, but he meant it as it would be understood in Hebrew Kain as Yes I am a Jew!
Regarding your second question, it would make seem that as long as he is not the one to declare that he isn’t Jewish, that it would be permitted.
See Darchei Teshuva Y:D 157-63 from the Sefer Chasidim that if a Jew hears someone saying that he isn’t a Jew that he has to say that he is a Jew, however the Maharshal says that if he had in mind that if he would be asked that he would say the truth then it is permitted since the Jew didn’t do anything to make the gentile think that he isn’t Jewish.