That's Descartes. Meditations. I believe the handless brain in a vat question. And how can o I know that I am not dreaming? Epistemology is super interesting. I believe he was referring to the fact that if he (I) could be forming thoughts, that there is some sort of consciousness doing the thinking. I don't think he ended up answering the question of whether or not he was dreaming, but others picked that up and have their arguments.