How and when does one not invest in others in Buddhism? It is my understanding that there were instances that the Buddha discontinued the teachings to a number of people. 

Putting aside the concept of me and others, i am often in the situation whereby i have continued to demonstrate that there are better ways to a given situation e.g. conflict, methodology, etc. People often continue down this path where it often leads to the very situation that could be avoided. This in turn results in more conflict, distrust, etc.  

This often leads to a moment of befuddlement since i am unable to comprehend the nature of people. Although we appear to have evolved and consider ourselves civilized, rather than direct conflict, these often result in passive aggressiveness which further erodes relationships and growth since now people harbor negative or non-conducive emotions. 

It also requires substantial emotional, mental and physical investment to help others.

How does one step away from 'teaching' or 'imparting' to others especially if one is in regular contact with them and depend on them to complete their responsibilities?
These kinds of questions will always be difficult to answer because we only have one side of the story. We lack the vital perspective that comes from a. knowing you, and b. knowing the people that you are in conflict with. The fact that you are in conflict, but don't seem to be able to acknowledge your part in creating the conflict tells me that I don't have the full story. However, one of my teachers gave me some excellent general advice on communication some years ago: he said that if a communication goes badly, then assume that you have not expressed enough mettā.

In order to relate empathetically one must drop one's own agenda (as teacher or benefactor) and try to feel what they feel and then ascertain the reasons they feel that way. One has to put oneself in their shoes. To do this one must drop all pretence of being superior and of having something to teach them. Drop all the conceit. If you have something they value, they'll ask you about it. That the situation has devolved to the extent you intimate, suggests that you are in conflict with their values. Perhaps you present yourself to them incongruously - you see yourself as having something to teach them, but they don't think of you as having anything to teach them. 

I think one is already in trouble if one is modelling oneself on the Buddha or if one is relating to people on the basis of "teaching" them or having something to "impart". It sounds like this is getting in the way of you establishing an empathetic relationship with them. Is the problem that they refuse to see you as a "teacher"? Is that why you are labelling their response to you as "passive aggressive"? 

The general principle of Buddhist ethics is that when things go wrong, that we looks for our own unskilful motivations. The unenlightened (dare I presume you are one of us?) are always motivated by attraction and aversion. Sometimes when things go wrong, one must just own up to one's own unskilful motivations. It can be difficult, because it is humiliating or humbling (depending on how you see it). In relating to other people we only have control of our side of the relationship. If things don't go right, we can only ask ourselves if our own attraction or aversion has soured things. 

Of course there are times when it is better to walk away. If one realises that one is too entrenched in attraction and aversion to make a change, for example. Sometimes the necessary change is too great to manage in the short term. But one cannot blame the other. For this. If relations break down, it is our own failure. Generally speaking if we are expressing mettā rather than conceit, there is no need for relations to break down. Of course, it's a big ask. 

But if the thought is "if only these people would follow my advice" then I would see this as problem of conceit, not of unreceptiveness.