It may happen that I ask a question and the problem shows to be a bug.
Should I just delete it?
Should I flag it to be closed and thus stay visible?
Should I post an answer linking to a bug report and possible solutions?
It should be closed as a duplicate of this question, but not deleted. There's no real answer that can be given since it's not a real question. So it would just be open forever. StackExchange isn't a place that we can use to track bug reports. I think the idea is that questions should be answerable. We should inform the OP that bugs are tracked in launchpad and link to the relevant tracker.
I've also heard people many times say that they "want to make sure it is a bug". However this process is already handled in Launchpad. Issues in Launchpad start out as "new" (aka unconfirmed) and they must be "confirmed". Part of the bug reporting process is confirming the issue. It is done much more quickly if everyone is reporting information in the same place.
There is also a guide on our website about how to make good bug reports.
Perhaps we should put together a canned response that contains all of this information?
This site does not aim to be, and should not be, a bug report or feature request site. If a question is clearly a bug report or a feature request, redirect the asker to the bug tracker. The best way to do that would be to:
(Note: an earlier version of this answer recommended closing as a duplicate of the canonical question, but this is not good because of a Stack Exchange feature: when anonymous visitors visit an unanswered question that is closed as a duplicate, they are automatically redirected to the duplicate. If someone finds a question titled “Why does my cursor disappear in Editor with an Nvidia graphics card?”, but lands on “How can I report an issue with elementary OS to the developers?”, that would be very confusing.)
If you recognize the bug as one that is already reported, post a link in a comment.
But don't be too aggressive on questions that may lead to a bug report. A lot of askers don't know whether what they're observing is a bug or not (it's hard enough for professionals to figure out sometimes!).
If a question is looking for ways to diagnose a problem, answer, explaining how to diagnose the problem. If the diagnosis turns out to be a bug, that's no reason to close the question: it's about the diagnosis, not about the bug.
If the question asks how to solve a problem, and the problem turns out to be due to a bug, do not close the question. Indicate how to report it as a bug, but leave it open for people to answer how to work around the bug.