This English expression is very old-fashioned and rarely used in daily conversations but can be found is much 20th century literature.
The expression is used to ask someone what they are thinking about. Generally it is asked to someone who looks as though they are deep in thought.
It is suggested that this expression originated from Thomas More’s book Four Last Things which was published in 1522. The book is a book of meditations about death and at one point we find the line “As it often happeth that the very face sheweth the mind walking a pilgrimage, in such wise that, not without some note and reproach of such vagrant mind, other folk suddenly say to them, A penny for your thought.” This is the earliest record of the expression in print although it is suggested that it may have been used orally before this date. The phrase didn’t become to be used commonly until it was published in Heywood’s 1547 book The Proverbs and Epigrams of John Heywood. The idea behind the proverb was that someone was so interested in what another person was thinking that they would have been willing to pay to find out.
An example of the usage of this idiom can be found in the title of an article in The Guardian which reads “Penny for your thoughts: Could micro-payments save the media industry?” In this context it is used to suggest that the idea that micro-payments could save the media industry is something which we should think about.