TL:DR: 0 < x < 15
Let us start with the overall requirement of the problem, that a carry-on bag must be under 40 pounds. The expression for this is easy, since the bag must be under, or at most equal to, 40 pounds. So the expression is:
x < 40 pounds.
There is also a lower limit to this problem, although it is not formally written, since we can't have negative weight in the suitcase (Weird quantum phenomena non-withstanding). It also would not make sense for the case to be entirely empty, since that would be rather pointless, so we would say the weight must be greater than, but not equal to, 0.
0 < x < 40.
So now we move on to the problem itself. The bag already weighs 25 pounds, so less weight can be added to the bag. Since we are being asked to write the inequality for the weight that can be added, we want the lower limit of the added weight (which would be zero), and the upper limit of the added weight (which would be our original 40, minus the weight that was already added, or 15). So the inequality would be:
0 < x < 15.
It should be noted that the left side of the equation is less than or equal to, rather than just less than, as it was in the first inequality, since adding no more weight to the bag is a physical option. It would go back to being just a less than if adding more weight was a requirement by the problem (i.e. Person A wants to add more stuff to their bag, what inequality would represent the amount of weight they can add.)