During the discussion on this problem I found the following simple observation:
If $M$ is a monoid and $a \in M$ then $\{x: ax = xa\}$ is a submonoid.
This is trivial to prove by checking identity and closure under multiplication. Is there a more structural/conceptual proof, for example one that introduces some ideal, a homomorphism etc.? I attempted to use the monoid algebra $\mathbb{Z}[M]$ or a monoid action $a,(x,y) \to (ax,ya)$, but couldn't formalize it.
I don't know whether to call the following a "structural proof" or a "fancied-up proof." In any case, it's different from the obvious proof.
Let $R$ be a ring. An additive function $d \colon R \to R$ is called a derivation if $d(xy) = d(x)y + xd(y)$ for all $x,y \in R$. It is well-known that any element $a \in R$ defines an inner derivation $[a,-] \colon R \to R$, given by $x \mapsto [a,x] = ax - xa$.
Here's the part that I'm worried may be considered "cheating": It's rather easy to compute that the kernel of a derivation $d \colon R \to R$ is a subring of $R$, which contains the multiplicative identity if $R$ has one (using $d(1) = d(1 \cdot 1)=\cdots$).
Now given a monoid $M$ and element $a \in M$, consider the monoid ring $R = \mathbb{Z}[M]$ as you mentioned above. Let $d = [a,-] \colon R \to R$ be the inner derivation defined by the element $a$. Then $\ker(d)$ is a unital subring of $R$, in particular a submonoid of $R$. One readily sees that the centralizer of $a$ in $M$ is equal to $M \cap \ker(d)$, and is therefore a submonoid of $M$.
Like I said above, I'm not convinced that this answer is in the spirit intended by the question. But I thought I would offer at least a proof from a rather different perspective.