IDK if this is the official way to solve the problem, but the way I'd approach it is to think first how much fat am I going to need at the end? How much, in liquid measure, is there in a gallon of 2% fat milk? In other words, what is 2% of a gallon? Let's do it in ounces, b/c we don't know yet if it would even make a full cup. So step one would be how many ounces in a gallon.
1 gal. = 128 oz. (You get this either from looking up the conversion online, or by multiplying 32 oz. in a qt. times 4 qts. in a gallon.)
Then step two, to find out how many oz. of fat would make it 2%, you multiply the 128 oz. by .02 (2%) which gives you 2.56 oz.
Now, the skim milk doesn't provide any of the fat, so you need to get it all from the half and half. Step three is how much half and half gives 2.56 oz. of fat. You need to write a formula for that. (12% of how much [half & half] equals 2.56. oz.) Written mathematically that is .12x = 2.56
Step four is solve the equation: Dividing both sides by .12 (to get plain x on the left), which gives you x = 21 1/3 oz. (If your teacher usually likes the answer in decimals you can go two decimal places & call it 21.33 oz.) So you need that much half & half in the gallon to give you the 2.56 oz. of fat you need.
Now that you have all the fat you need in the gallon, step five is to find out how much skim milk you need to fill up the gallon. That is 128 oz. - 21 1/3 oz. = 106 2/3 oz. or if your teacher usually wants the answer in decimals, you could round it to two places and call it 106.67 oz. of skim milk.
You can't just copy and paste what I wrote b/c there is not supposed to be all those words I used to teach you how to do the problem. Just pick out the math part of it, and write each step in numbers.
ON EDIT: If you divide the answer I got in oz. by 8 to get the amount in cups, you will see that it matches what the other two people who solved the problem said. Theirs has more of the problem written in math, so I'd go w/ one of theirs.