I invited a coworker with shared expertise to collaborate on/coauthor a paper (both postdocs). The result was ultimately much better due to this input. He also had an idea for an alternative approach to 'my problem', and published a second paper with me as coauthor. While this is beneficial in the sense that it increases the quality and volume of both our output, I find the situation highly stressful. I am not aggressively competitive by nature and feel that his behaviour is arrogant and offensive. I understand that once you have published a result, any generalization thereof it is ‘up for grabs’. However, people with access to your unpublished work have an ‘unfair’ head start. Is there an unwritten understanding with respect to crossing the borders between the territory of your coworkers? How can I avoid this type of conflict/coworker in the future? Am I being overly sensitive and need to develop thicker skin/not cut out for this type of business?
Science is a collective endeavour to build and spread knowledge, improving our understanding of nature. Collaborating and building on each other's expertise with proper recognition is a must.
You collaborated with a colleague of yours, and not only did this joint effort produce a better result, but it also produced a further result, unforeseen at the beginning (and which, for you, came almost for free).
Celebrate the successful moment, hope that all your future collaboration will work out smoothly and productive as this one, and if necessary rethink carefully at your motivation in doing science, to avoid being stressed by something that should be the normality (and that too frequently, alas, is not). That is, be competitive against yourself to improve yours and everyone's knowledge and not against someone else.
It is rather common for a problem or question to be generalized, that does not mean that the original problem becomes void. Furthermore, the very reason to publish a paper should be to interest others in the topic and not to just increase your paper count. He also included you as a co-author in his paper that, given your formulation, he wrote almost by himself based on your work together, so I'd think that he is more than willing to give you credit for your work.
I would suggest to communicate with the coworker and discuss future work on this field. There are three choices here:
1) You both want to continue to work together on the topic. No problem then, just do it; you only need to decide who is first author, if that is an issue in your discipline.
2) You both want to continue to work on the topic, but not together. That might cause some problems and I would suggest to agree on different aspects for you to work on if possible, otherwise you might happen to publish similar results at around the same time.
3) One of you doesn't want to work on the topic any more. Then the other is free to do as he pleases, of course giving due credit to the other author by citing your joint papers.