The British entertainer Lonnie Donegan released this fun tune in 1959. It was originally written and recorded as "Does the spearmint lose its flavour" in 1924, Billy Rose who co wrote the lyrics (with Marty Bloom and music by Ernest Breur) was married to Fanny Brice and also wrote other songs including Me and My Shadow.
Anyway back to the song, Lonnie Donegan rewrote quite a lot of the lyric, but also had to change spearmint to chewing gum as 'spearmint' is a trademark name in the UK and the BBC wouldn't play the song with spearmint in the title (a similar thing happened with the Kinks' song Lola, where 'coca-cola' had to be changed to cherry cola!).
So the question posed by Lonnie in the song is one that has baffled scientists for many years and chewing gum does sometimes retain flavour on the bedpost overnight. I would suggest that even in these austere times it is probably wiser to actually throw the chewing gum away (don't even swallow it in spite) than keep it on the bedpost, even if you are fortunate to have a bedpost.