For protein: every ounce of fruits gives 6 units of protein and every ounce of nuts gives 5 units of protein. We have x ounces of fruit and y ounces of nuts, so we get 6x + 5y units of protein. We need this to be at least 6 so the inequaity is
6x + 5y ≥ 6.
Similarly, for carbohydrates we will get 6x + 4y units and we need to have at least 12, so the inequality is
6x + 4y ≥ 12.
For the fat we will get 5x + 5y units, but this time we have a maximum, so we get
5x + 5y ≤ 10.
Obviously we also need x and y to be non-negative.
If we draw out these inequalities on a graph, we'll find that there's only one feasible point, which is at (2, 0). This makes sense: two ounces of fruit puts us squarely at our maximum possible fat and our minimum possible carbohydrates, but replacing fruit with nuts will increase the fat and decrease the carbohydrates, which we can't allow. So we can't have any nuts and we can only produce 2-ounce bags of fruit, which will yield 12 calories.
(Maybe there's a typo somewhere? The minimum number of carbs looks too high. The minimum amount of protein doesn't even need to be considered because the minimum number of carbs amply ensures we have way more protein than we need.)
In general we'd graph out the inequalities and determine a feasible region, which would be bounded by several line segments, and we'd check the number of calories achieved at each corner to find the best one. But since there's just one feasible point we don't need to investigate any further.