Having trouble understanding how tension works inside a rope So my teacher drew this diagram explaining how tension works inside a rope

And he said that when we pull on the first molecule of the rope, the molecule pulls back, and the molecule adjacent to that molecule pushes the molecule and so on.
I can't really explain it because I myself am confused. I couldn't find any source explaining how tension works in a rope from google. 
So can anyone please explain how tension works in a rope to me?
 A: If you consider each molecule in the rope the net force on each of them will be zero because they are in static equilibrium.
For atoms inside the rope these forces will be provided by the neighbouring molecules as shown in your diagram.
For molecules at the ends of the rope some of the forces are provided by neighbouring molecules and the rest by forces which are external to the rope as shown on your diagram.  
 
You can think of the molecules as being connected together with springs (bonds) and when external forces are applied to the ends of the rope those spring lengthen a little (the rope stretches).
Each molecule has larger forces acting on it produced by neighbouring molecules but the net force on each molecule is zero.  
The total external force acting to the left on the molecules along the left edge of the rope which is called the tension is equal to the total inter-molecular force to the right acting on those surface molecules.  
The total inter-molecular force to the left acting on molecules along a vertical line inside the rope in your diagram is equal to the total intermolecular force to the right acting on those molecules and that is what is called the tension in the rope.
The tension is the rope is the external force one would have to provide to keep both part of the rope together if the rope was cut ie the inter-molecular forces no longer existed and something external to the rope provided the forces.  
Update in response to a comment

The inter-molecular force against separation of molecules graph looks something like this.

When the rope is not under tension the separation of the molecules is $r_{\rm o}$.
If one starts to increase the separation of the molecules (ie stretch the bonds/springs) between the molecules the forces become larger but the net force on a molecule stays at zero.
There is more about inter-molecular forces here.
A: Thinking the rope consists of infinitesimal sections of continuum matter, instead of molecules is a better approach. This is the best if we want to explain the system with classical physics indeed.
So let's imaging your rope split into infinitesimal sections. Since the rope, once is pulled from both sides, it remains static, it implies that the net force has to be zero. 
Then you may ask, but where are these forces exerted so that they balance?. As @Farcher  said, as the rope is a sole entity, the sections has to interact within each other. For instance by a force like the ones a spring exerts when it is pulled. 
Again I invoke the static equilibrium and the forces between sections are also balanced. The exact nature of the force doesn't matter. Just to think that by empirical evidence these forces have to balanced. Otherwise there would be some kind of acceleration (and you don't spin with increasing speed when you straighten a rope). So each section automatically is balanced by the pulling force, let's say from the right hand, plus the force pulling from the left hand. And each section composing the rope is characterized by this zero sum of forces.
Finally, you need to think in terms of static equilibrium and to imagine the rope as composed of smaller entities (molecules, continuum differential sections) that interact within each other, to understand how a rope acts under tension. 
