What friction vector direction will be in this case? 
Two bodies 1 (at the top) and 2 (the rightmost one) with same masses are connected to each other with lightweight non-expandable thread thrown over sheave. The block A has an acceleration a. I need to find the minimal value of acceleration a, which allows bodies 1 and 2 to stay still relative to the block A.  Coefficient of friction  between both bodies and block A equals µ = 0,20. 
In order to find this a I need to write down equations of Newton's 2nd law for every body. I'm struggling with friction for body 1 (the one that's on top of the block A). 
On one hand we have thread tension force which pulls body 1 to the right. The friction that prevents the body being pulled to the right is pointed to the left. Ok, So far so good. 
But on the other hand block A is moving to the right. Since Body 1 pushes down on block A with it's weight the friction between them acts on block A which is pointed to the left (against direction of movement of block A). But according to 3rd Newton's law, the exact same force is acting on body 1 at the same time but pointed to the opposite direction - to the right.
Thus we have two vectors of force of friction seemingly pointed in opposite directions acting on body 1. What would Newton's second law equation look like for 1 body then? Will there be two vectors related to force of Friction or will there be just one resulting? If so, what will it be equal to? In what direction will it act?
 A: The language of the question implies that the initial state (before increasing the acceleration to the desired amount) is one in which $m_1$ is being pulled to the right (relative to $A$) by the force of gravity pulling $m_2$ downwards. The minimum acceleration $a$ is one at which, as you approach it from below, the acceleration of $m_1$ approaches $0$.
What you can see from this is that the frictional force $F_f$ is directed to the left (relative to $A$), because the initial state is one in which the mass would be moving to the right (relative to $A$).
A: There is just one friction force acting on body 1. It depends on the sum of the other forces acting on body 1 (for example, if you use a reference frame where the accelerating block is still, it's the fictitious force $-ma$ and the tension force). It may be equal anything from $-\mu mg$ to $\mu mg$ if body 1 is still relative to the block. Ideally, one should consider different cases and choose the case where $a$ is minimal. Maybe some other considerations can be used to eliminate some of these cases.
EDIT: (10/28/2017): More details: I use the reference frame where the accelerating block is still, so the fictitious force $-ma$ acts on the two bodies. If the tension in the thread is $T$, then the condition of equilibrium for the two bodies (taking into account the friction) are:
$$|T-m a|\leq\mu m g,$$ $$|T-m g|\leq\mu m a,$$ or $$-\mu g+a\leq\frac{T}{m}\leq\mu g+a,$$ $$-\mu a+g\leq\frac{T}{m}\leq\mu a+g,$$therefore,$$-\mu a+g\leq\mu g+a,$$ and $$a\geq\frac{1-\mu}{1+\mu} g.$$ One can check that the minimum value $a=\frac{1-\mu}{1+\mu} g$ does provide equilibrium and one can also find the direction of the friction for such value of $a$.
