Me to Mum when I was getting her ready for her shower: OMG you're not wearing any underwear! Why aren't you wearing underwear? MUM: I Don't know! Me: How could you not know? Mum: I don't know! Me: We're not going commando! Gotta love her. Believe me I'm checking from now on!
You might want to spend some time reading the articles here on dementia and its various stages so you can anticipate these kinds of episodes and react accordingly.
She can't help recognizing or not recognizing, so find ways to deal with the situation w/o criticism. Say something like, "well, then I guess we can look through your underwear drawer and find something pretty to wear today."
As others here, as well as articles, will advise: redirect, and keep the situation light.