As it was observed by ADL in the comments, one can use the fact that free groups are residually finite to conclude that free monoids are also residually finite as a corollary (on this site, here is a collection of proofs that free groups are residually finite).
But here is a proof that the free monoids are residually finite which is simpler than a proof that the free groups are simpler. Let $A$ be a finite set. For each $a\in A$, let $L_{a,A,n}:A^n\rightarrow A^n$ be the mapping defined by letting $L_{a,A,n}(a_1,\dots,a_n)=(a,a_1,\dots,a_{n-1})$. We can define a monoid homomorphism $\phi_{A,n}:A^*\rightarrow (A^n)^{A^n}$ by letting $\phi_{A,n}(a_1\dots a_r)=\phi(a_1)\dots\phi(a_r)$. Then $$\phi_{A,n}(a_1\dots a_n)(b_1,\dots,b_n)=a_1\dots a_n,$$ so the input $a_1\dots a_n$ can be recovered from $\phi_{A,n}(a_1\dots a_n)$.