The trick in this question is the use of the phrase “buys it back”. This trips up people who are not paying attention. The fact that it’s the same goat is also a distraction meant to trip people up.
What you do is strip this problem down into business transactions stated in simplest form.
Purchase transaction $60 (item is irrelevant)
Sale transaction $70 (of said item)
Profit is amount you were paid in the sale less the amount you paid for the item.
Profit = Sale – Purchase = $70 – $60 = $10.
This is repeated for the second transaction giving another $10.
So the profit is $20.
Looking a bit further.
The other guy also made $10 by the way.
Where did the $30 total profit come from? It came from the guy who bought it at $90.