Drain pineapple, reserving juice; set pineapple aside. In a saucepan, combine sugar, flour, vinegar and reserved juice until smooth. bring to a boil; cook and stir for 2 minutes or until thickened. Remove from the heat. Stir a small amount of hot mixture into egg; return all to the pan; stirring constantly. Bring to a gentle boil; cook and stir for 2 minutes. Remove from the heat; cool.
Fold in whipped topping. Fold in the apples, marshmallows and reserved pineapple. Cover and refrigerate for 1 hour. Just before serving, fold in the peanuts.