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: 
I think this also depends on your age. But putting that aside you should treat yourself to whatever you can get your hands on and eat the motherload out of it. Then get yourself in the weight room, decrease the cardio to a minimum, and hit some solid weights. Don't worry about any strict programming in training, merely focus on doing something. After the body goes through the adaptation process you can look into certain workouts posted in t-nation or even bodybuilding.com. Any of those will work.

As for diet add olive oil to everything, have protein shakes like no tomorrow, try to drink a half of gallon a milk a day, eat eggs like their your girlfriend. After you get a good increase of quality protein meals in your system, have hit the weight room 3-4 times a week, diminished cardio then look into refining your structure. It will come naturally since you learn how your body reacts to certain movements, meals, etc. You will build an excellent rhythm after a few weeks and months and fall in love in training. Here's a trick: **Try to really focus on a heavy protein diet and training for 14 days straight**. You'll kick start a habit ritual in your system and everything else will seem easy from then on.

After training for 3-4 years on a very consistent basis you can really drill down the details that will help you get your squat over 600pds and get your bodyfat % below 9%. Then you're on fire and will look back at your post and laugh at your 3 pushups. Until then it's being super consistent, have a big freaking breakfast for quality energy throughout the day and punch it hard like Chewie did.
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