How to cite something when you cannot remember where you've read it? Let's say you're writing a paper about a novel problem in Mathematics. While writing the paper you remember an interesting result concerning a different related problem. You can derive that result from memory, but you cannot remember where exactly you've read it - it could've been a paper, a pre-print on Arxiv.org, a post on Math.SE, a book from the library, a lecture that you've attended, etc. No matter how hard you try you cannot find the exact source.

What is one supposed to do in this situation?
Since you're already here, an obvious step would be to post a question on a relevant Stack Exchange site. (Other websites are available.) Such questions are routinely asked and answered on MathOverflow, for example.

Similarly, asking colleagues can also work. They don't necessarily need to be people you know personally either. There's often someone in a field with a reputation for a "near-encyclopedic knowledge of the literature" you could send an email to.

However, if nothing works, honesty is the best approach. Just present it as a known result of unknown origin, or something to that effect. Here's an example where that kind of formulation is used for a problem, not a result, but the same idea applies.