Here are counterexamples from geometry. Lets call a set "good" for convenience when it satisfied your property.
The good set is not necessarily unique. Take $A=\Bbb R^n$ and $M$ the monoid (actually group) of translations on $\Bbb R^n$. Choosen any point $x\in \Bbb R^n$ and set $X=\{x\}$. Whereever $f$ maps $x$ to, there is a unique translation moving $x$ to $f(x)$.
A good set does not necessarily exist. Take $A=\Bbb R^n$ and $M$ the monoid (actually group) of distance preserving maps. For any set $X=\{x\}$ with only a single element, there are several distance-preserving maps in $M$ moving $x$ to $f(x)$ (with different rotations). However, when $X$ contains more than one element, then $f(x)=0$ is not distance-preserving and therefore there is no map in $M$ which can reproduce $f$ on $X$.
I initially thought that even though a good set is not unique, it might be essentially unique in the sense that all good sets $X_1$ and $X_2$ are of the same cardinality and hence (easy to prove) $X_1=iX_2$ for some invertible $i\in M$. However, as it turns out there are examples of where there can be good sets of different cardinality:
Example. There are rings $R$ for which the freely generated left $R$-modules $R^n$ and $R^m$ are isomorphic, even though $n\not=m$. This means that e.g. $R^n$ has a basis of both sizes $n$ and $m$. Choosing $A=R^n$ and $M$ the set of endomorphisms $A\to A$, any basis of $R^n$ is a good set.