Question: I am underweight and only able to do 3 pushups at best. I am wondering what I should focus on: getting stronger or gaining weight?

Answer: 
Focus on getting stronger.

You may also gain weight (if you're underweight), but it will just happen naturally when you lift weights and feed yourself enough to support your strength gains.
Well by gaining weight and not strength essentially means you'll be gaining fat???!! Meaning you may not be able to do those 3 press ups at all.

Focus on strength - check out my answer on a previous question:
[Is this program good to achieve functional strength and fitness?](https://fitness.stackexchange.com/questions/7059/is-this-program-good-to-achieve-functional-strength-and-fitness/7089#7089)

Train simple and hard, eat and rest! Good luck