I'm sorry they did that, you do need PIP. PIP is not an out of work benefit, it's to help you with extra costs whether you're in work or not. You really need to get the CAB involved, they've helped me lots with my PIP appeal. Your first step will be a 'mandatory reconsideration' but don't be disheartened if they still refuse because it's very common. I'd ask for a copy of the medical report from your assessment so that you can see where they've lied. I know for me they often gave me points for 'prompting' but what I actually need is social support and they've used my not having specialist input from MH against me, y'know, because it's not because the NHS are crap... I wouldn't have known this if I didn't see the medical report so try and get a copy ASAP. I think that you'll have about a month to complete the MRC and when that's done it's best if you prepare for an appeal straightaway, they delayed sending me the letter and I only had about 10 days to sort an appeal out. The CAB see a lot of PIP MRC"s and appeals so the sooner you book the better your chance of getting an appt.
The system is so unfair, especially regarding MH probs/autism etc I.e, the 'invisible problems'. I'm so angry with them.