What to do when you reach a conclusion and find out later on that someone else already did? Say you've thought hard about a specific issue in your research and have elaborated a possible answer, interpretation, etc., to tackle it. (I'm not thinking about huge research subjects, but rather small ideas that articulate a demonstration.) You then discover later on, while reading a new paper, that someone has thought about the exact same thing. How do you present your idea on the issue?

On the one hand, you can't pretend that you haven't read what the other paper says about it, both for reasons of intellectual honesty and because the other author (or someone who read his paper) might think that you stole his idea. Citing the other paper is thus somewhat of an obligation.

On the other hand, it doesn't feel right to dismiss your demonstration and just cite the other paper, since, after all, you figured out a solution on your own. Conversely, it seems somewhat pointless (and maybe arrogant), to write explicitly that you reached the given conclusion and only then found the other article.

What to do in such circumstances?
Do not despair: your work likely still has value!

In my experience, it's almost never the case that work addressing the same problem has exactly the same solution or exactly the same approach to gathering evidence.  Existence of a previous publication will thus typically make your results smaller and more incremental, but not invalid or duplicative.  Some examples of what your work may provide:


A second, independent confirmation of a hypothesis
Confirmation of a closely related but different hypothesis
A different approach that has advantages in some situations and disadvantages in others


There are even good journals like PLOS ONE that explicitly invite replications and "non-notable" incremental work.  Thus, if you've got a set of results in hand and you discover somebody else has done much the same, you should still write up your work---just be straight and honest about the smaller size of contribution based on the prior work.

If you're still at the "ideation" stage where you're just thinking up possible work to do, however, then it seems more appropriate to move on and work on something else instead---maybe building on their results.