How to overcome feelings of incompetence/failure in a PhD programme? I've recently quit my job as a maths teacher after doing it for 3 years and I have been incredibly lucky to be offered a fully funded doctoral training course at a top university. This is an extraordinary opportunity for me, especially given that I previously withdrew from a PhD, and this time I really want to make it work.

I am quite rusty on some things that many other starting students will not be, not because I can't do them but because it's been a very long time since I needed to apply them. I am currently a bit worried that I may be the weakest in the cohort or that it'll take me a very long time to understand simple things and that I may feel incompetent and like I don't deserve to be there.

What are some good ways to overcome these feelings of idiocy?
You have to accept that you are rusty and need to brush up on things. It is what it is, but there are others, myself included, who started a PhD after a few unproductive years. 

The number one thing to do is not to take more classes than you're required to. If you are in the US system, there will be tons of homeworks and class work, so you need to make sure you will not fall too far behind. Your first objective is to pass the qualifier exam if your university has one. 

But, you will also need to get an adviser, who will want you to do research. You need to pick wisely. Your adviser must be able to support you, especially if you are not allowed to teach. It is better to find someone who is a good planner and doesn't expect a student who takes classes and probably teaches to also do 60+ hours of research work. Not that it wouldn't be beneficial. 

If teaching is included in the time balancing act, you have to be careful that your students do not abuse your time. Be strict with office hours, and be hard to find especially when preparing for your own exams.

The part with getting up to speed is harder, but be open and let people help you. If you have questions, do not be shy to ask your younger peers, or the course instructors. Also, participate in group study, especially if you feel it helps you and check homework results and discuss them with colleagues. You will learn a lot, but it will also help you understand more accurately where you stand in terms of knowledge compared to your colleagues. Even if you are more of an introvert and work a lot better alone, you still need the interaction with your peers. 

Another thing is to plan alone time far from work. You have to have a more relaxed day, at least, when you don't have any work planned or you will end up burnt out and depressed. Also, if you have a family already, you have to understand that the PhD will take you from them more than a normal job would. Make sure you have a discussion with them where you set the expectations, and also try to leave the work at work as much as you can.