What would you call someone who will act like you're being racist to defend themselves even though you're not? For example, in a book I’m reading from multiple perspectives, one of the characters is Puerto Rican. When someone try’s to correct their spelling they ask them, “do you think Puerto Rican’s cant spell?” They never said Puerto Rican’s cant spell and were just trying to be helpful. Another example of this is when someone calls another person racist for stating the color of their skin, without saying anything else along with it, before it, or after it that could seem racist. I was thinking that the character could be considered falsely accusing but was curious if there was a better word for this that anyone knows of.
You may find some of the phrases in the following excerpt relevant. From Psychology Today:
As infants turn into children and children into teenagers, some people acquire other racial accroutrements [sic] like a race filter through which all their experiences are seen or various sizes of race chips that sit on shoulders burdened by a life of slights, insults, discrimination and outright hostility.
The problem with the race card is that noone [sic] is allowed to use it. When a white person suggests that a black person is using it, the white person is accused of being 'in denial' about race, racism, discrimination and history. When a non-white person uses it, they are accused of defaulting to race as an 'excuse' for whatever it is that transpired. Noone [sic] can win with the 'race card' and yet there it is: Ready to be 'played' and everyone in fear of what will happen when it does get played.
It would appear that the characters in your two examples are displaying race filters or carrying race chips, resulting in their playing the race card.
Note: A community member added the single-word-request tag to OP's question after I posted this answer.