I have just started the book -An Elementary Introduction to Mathematical Finance by Sheldon Ross. Please see the image (Pg 76): -
Assuming the stock can only take either of the two prices: 200 or 50: then, according to me, when the stock price is $200$, the pay off of investment should be :
$200 y - 100y(1+r) $ ( because the net investment is $100 y$ and not just the amount borrowed from the bank.
Similarly: when the stock price is $50$, the payoff of investment should be :
$50 y - 100y(1+r) $
Could someone please clarify !

The payoff, in this case, is the value of the investment itself. The payoff is distinct from the price. The profit would be the difference between the payoff and the price.
The point that Ross is making in this section is that if there is a second investment with identical payoff structure, it must have the same price, or there is an arbitrage, since you could otherwise sell the more expensive investment and buy the cheaper one.