I cooked some corn in boiling water today, and immediately wrapped it in aluminum foil after taking out of water. 5 mins later, I found out the colour of the foil changed, I'm not sure whether the corn is edible... please help
There are two likely causes for this kind of discoloration in foil. Neither makes the corn unsafe to eat.
The more likely cause is that you cooked the corn in heavily salted and/or chlorinated water and it was still damp when you wrapped it up. Salt, chlorides, and moisture react with aluminum and cause it to discolor and eventually corrode.
The second possible cause is the same reaction you get from tomato sauce and foil. Very acid, moist foods like tomato sauce will strip metal ions from foil. Cooked corn is weakly acidic, and could produce similar but lesser corrosion. This is not the likely cause, though, because it would require the wrapped corn to be in contact with a second metal.
In neither case is there any issue with eating the corn, except some possibility it might taste bad. A handful of aluminum ions is harmless to you, as the corn itself natively contains more aluminum molecules than that.