Suppose all the surfaces in the previous problem are rough. The direction of friction on B due to A

The direction of friction on B due to A will be upward because the weight of the block will be in downward direction and to balance or to oppose the downward force, the frictional force will be upward.

1