We know that x and y must be whole numbers (positive integers). Divide through by 14 and write only the remainders: 11y=5. We are looking for a value of y that when multiplied by 11 gives a multiple of 14 with a remainder of 5. When y=3, 11y=33 and 33=2*14+5. Put y=3 in the original equation: 14x+3*39=145, so 14x=145-117=28 making x=2. So (2,3) satisfies the equation. Reid sold 2 pairs of pants and 3 shirts if x=pants and y=shirt. He sold 3 pairs of pants and 2 shirts if x=shirt and y=pants. We don't know what the numbers represent, but if they represent money, you would expect pants to cost more than a shirt. If this is the case x would represent shirt and y pants.
Why does this work? We can write the original equation as x=(145-39y)/14 and we can write 145 as 10*14+5. We can also write 39 as 2*14+11 and x=((10*14+5)-y(2*14+11))/14=(10*14-2*14y)/14+(5-11y)/14=10-2y+(5-11y)/14. So the fraction (5-11y)/14 must be a positive or negative integer and we can write it as |5-11y|/14, where the modulus || is used to indicate that the difference between 5 and 11y is what we need, and it doesn't matter which way we do the subtraction. You'll see that y can be 3, 17, 31, etc., with gaps of 14. However, if we pick, say, 17, x would be negative, and that has to be ruled out. So y=3 is the only solution and x=10-2*3+(5-33)/14=4-2=2.
This type of equation is called a diophantine equation, named after the Hellenistic mathematician Diophantus of Alexandria.