If a is the original price of the apple, then a-0.2a=50, that is 0.8a=50 because 20%=0.20=0.2.
20% discount means that 50c is 80% of the original price a of the apple so 0.8a=50, a=50/0.8=62.5c.
Let's see if this is right by working out 20% of 62.5=12.5c. 62.5-12.5=50c which matches the price paid.
Realistically, the price of the apple before discount was probably 63c because there are no half cents in the currency. 1c is the minimum currency.
20% of 63=12.6, so 63-12.6=50.4c, which rounds to 50c.