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.
Honestly, I think whether you are over or under-weight it is never healthy to fixate on the scale. Total body weight is like a thermometer, it only tells you if something is wrong--but it doesn't tell you what it could be.

Gaining muscle requires that you work hard, and eat a lot of food. For some reason, there are people who's bodies tell them they had enough food very early. Other people whether through years of ignoring the full signals or just genetically don't get that feeling as quickly tend to pack on weight. The hormone most associated with this affect is Leptin. If you struggle to put on weight, your body either makes too much of it, or is too sensitive to it and you stop eating before you can gain weight. If you struggle with gaining weight, then the body either doesn't make enough Leptin, or it is too insensitive to it.

Leptin, like insulin, is sensitive to carb intake. Also like insulin, overstuffing yourself with carbs over time will make you insensitive to that hormone. For people already overweight, backing off carbs for a few weeks will help restore some sensitivity. If you are underweight, you may want to pack up on carbs during this time. The purpose is to decrease your sensitivity to leptin.

That said, make sure you have the physical activity to match the food. Work hard to the point of depleting all the energy from you muscles, and then eat a meal with a decent amount of protein, but go for a lot of carbs. It really doesn't matter at this point what kind. The bulk of what you eat will go into your muscles to replenish what you need.

So if you work your diet like this:

* Protein: ~1g per pound total body weight. remains constant--easy to figure out
* Carbs on rest day: keep it low. No more 0.5g per pound total body weight.
* Carbs on training days: ~1g per pound total body weight, most after training
* Fat: fill in your caloric needs to move towards your weight goals

You should be able to get bigger and increase your body weight in a way that still looks good. The same structure can be used to lose weight--but in that case you should probably take 10 days and keep the carbs at or below 30g, and on rest days keep the carbs as low as 30g.