You might be sent to a consultative mental examinations if you have no current mental health treatment notes or no record of mental health treatment at all. If you have a documented history of visits with a mental health professional that is up to date (within 90 days), you shouldn't be sent to a consultative mental exam.
It's a good rule of thumb to be truthful and give any mental health testing (IQ testing, memory scales, etc.) your best effort. It is unlikely that you can "fool" the mental health examiner who administers the examination. From time to time, an applicant for disability benefits has tried to answer mental exam questions to try to get approved for disability benefits. I remember one specific individual about whom, on three separate occasions, the psychologist indicated in the CE (consultative exam) report that the results of the intelligence testing could not be considered valid because the claimant clearly gave less than his best effort. The claimant ended up being denied for benefits. However, the claimant's educational history and medical record documentation pointed to a lifelong history of impaired cognitive function - -something that might have been adequately substantiated by testing had the claimant not tried to "game the system."
If you don't try your best at a mental exam, the doctor will probably note their suspicions in their CE report. As a disability examiner, I frequently saw reports generated by consultative physicians and psychologists that stated that an individual had not given their best performance or were even malingering (faking).
In short, if you genuinely have a mental health impairment that prevents you from working and you have a consultative examination, give your best effort with no consideration as to the outcome of the testing. Because if a consultative physician or mental health professional suspects that you are not giving an honest portrayal of the limitations caused by your mental condition, your claim stands a good likelihood of being denied. And once there is a notation of malingering in your disability case file, it will be hard to win your disability claim if you have to use the Social Security disability appeal process.