It was very easy in the old days. There was an experiment done in the 60's - perfectly sane psychology students were told to persuade the mental health physicians to allow them to be committed. All they had to do was say "I hear a voice in my head that says Thunk". That was it. That's all they said: "I heard a voice in my head that says thunk. Just thunk. Nothing else", and they got committed (voluntarily, of course).
Now, depression and schizophrenia are real diseases, but they aren't that difficult to fake. Depression, I have it on good authority, is supremely easy to fake. Just walk into a doctors office, put on an emotionless, blank face and adopt a monotone and say "I oversleep and sometimes undersleep. I'm under a lot of stress. I zone out all the time. Sometimes I just stare at the walls. I have no energy to do anything. I don't know what's happening to me. I've been feeling this way for a long time". As long as you can act reasonably well, just rattle off the symptoms and they'll diagnose you with depression
(once again, I am at pains to point out that Depression IS a real sickness, it's just one that is EASILY faked by anyone who knows how to act even remotely competently)
As for faking a mental illness like schizophrenia - it can be done. Claim to hear voices. Don't over-react and say that the voices are telling you that you are the emperor of Mars (at least not yet). Just say that you hear random voices saying things about you. To really put on a show, claim that they are not voices at all, but that people are talking about you behind your back. When talking to the doctor, randomly stop and stare angrily and say "WHAT did you just say about me?"
Of course please DON'T actually do this - while it is relatively easy to fake insanity it is NOT easy to convince them that you are really sane. Once they decide that you are crazy, your actual sanity is dismissed as "an act" to get out of the hospital. Plus, faking mental illness takes money and time away from treating those WITH actual mental illness. It's a selfish thing to do, and it's not respectful to those who actually are sufferers.
So while it is reasonably easy to fake insanity/depression/eccentricity, it is
1) Selfish - you take up the doctor's time and you divert resources away from treating those with actual illnesses
2) Dangerous - your fake illness might be taken VERY seriously. Those who fake mental incapacity to avoid jail often regret it as they are then stuck in an asylum, and let me tell you it is NOT fun to be in a mental asylum. I've never been, but I've worked near one at the PA Hospital. You could hear the screams through the lab walls. Also, it can be very difficult to convince the doctors that you are sane, once they've decided you are crazy. They might also force you to take medication with nasty, NASTY side-effects.
3) Unnecessary - there are better ways of getting attention/getting out of work/getting into an asylum. The only reason anyone would want to fake a mental illness is if they are facing life in jail or the death penalty, or if they need to get away from the mob.