Ref. image \(I\)
Given that acceleration of block B is \(2 m / sec ^2\)
Drawing \(FBD\) of \(A\) ref. image \(II\)
\(f _2\) frictional force due to \(B\)
Now \(=\frac{ f }{ m }= a\)
\(\Rightarrow \frac{ f }{5}=2\)
\(\Rightarrow f _2=10\,N\)
\(10\,N\) of frictional force is applied by \(B\) on \(A\)