Besides the trivial case where you later find the answer by yourself, when would one answer their own question?
For example, if I found a cool trick while going through some math contests, could I share them in the form of a question and answer?
In general I don't think it should matter who answers a question. If a question meets the standards for the site, you can answer it or someone else can answer it. So I would say that you can selfanswer any question that would otherwise be acceptable for the site.
Now, others might like you to show a bit of restraint and not post routine exercises about trivial facts. Maybe you could reserve answering your own questions to when you have that "really nice question". So, if you "found a cool trick while going through some math contests" and wanted to share this, that would be fine.
Please remember to search for duplicates before posting. It would be annoying (to you) if your question was closed because it is a duplicate.
Also, some have suggested to mention in question itself that you intend to answer the question yourself.
Oh, and this has been discussed in the past several times: