This can happen in old age because of 2 reasons first it can be dementia that develop slowly over the period of month mostly in patient with
diabetes hypertension pure vegetarian or alcoholic . In such cases need evaluation with brain imaging, blood test for
thyroidB12 level hemoglobin and
sugar.
Second possibility is developing acutely lasting for few hours to few days and then coming to normal. Then it may be delirium in which temporally brain will not function properly because of some other reason like infection, lack of sleep, constipation or electrolyte imbalance, stress. For this we have to evaluate and find out and treat the cause.