Your doctor is right about breastfeeding until 2 being the WHO recommendation, but it is not necessary to give formula past the age of 1. I pumped at work until my daughter was about 12.5 months. She was eating plenty of solids when I was not there and I made sure to give her plenty of high calcium foods because at the time she would not drink cow's milk. She was also still nursing very frequently when we were together so I wasn't concerned about her nutrition at all.
My point is that it probably won't be necessary for you to pump when you go back to work, although if you want to do so you can. You will probably want to plan to pump a little bit at first so you don't become engorged, and then wean yourself off the pump. Your body will adjust to producing milk at times when your child nurses, so in the evenings and weekends you will still have milk for your child even if you don't pump during the day.
“We are not put on earth for ourselves, but are placed here for each other. If you are there always for others, then in time of need, someone will be there for you.”