I have found a lot of examples of such functions, for example, here, but I don't understand how to come up with such and how it is explained/proved like it is done in the top answer to that question.
Could somebody please help me come up with one and explain it to me?
Thank you in advance!