Since this is clearly a homework problem, I'll guide you along. We're not here to just give you the answers to your homework.
First of all can you tell me the formula for Magnesium Oxide? How many magnesium atoms and how many oxygen atoms in each molecule of magnesium oxide? If you don't know, a 10 second Google search will tell you the answer.
Once you know how many of each atom there are in the molecule, you can find the ratio of the total weight of the two elements. For example, to find out how many AMUs (atomic mass units) of oxygen are in a magnesium oxide molecule, you'd multiply the number oxygen atoms per molecule times the atomic weight of oxygen.
The ratio of the weights of the two elements in one molecule will be the same as the ratio of the weights in any amount of the compound. Thus, you'll be able to write an equation setting the ratios equal to each other:
Just solve for
x, and that's how many grams of magnesium would be required to fully react with the 2.5 grams of oxygen. If the result is less than 5.00g, then clearly there's some left over. If it's greater than 5.00g, then all of the magnesium would get used up, and there wouldn't be any left over.