Is this an automorphism of a commutative ring of characteristic $p$?
Let $F$ be a field of characteristic $p$ and consider the ideal $(X^p)$ generated by $X^p$ in the polynomial ring $F[X]$.
Then $R=F[X]/(X^p)$ has characteristic $p$ and contains an element $r$ such that $r\ne0$ and $r^p=0$.
If you consider $K=F(X)$ (the field of rational functions) and an indeterminate $t$ over $K$, then the endomorphism $f(t)\mapsto f(t)^p$ of $K(t)$ is not surjective, because $t^p-X$ cannot be a $p$-th power.
Even if R is a field, the question has no trivial answer. In that case, it is an automorphism iff R is a perfect field. The endomorphism you are looking for is called the Frobenius endomorphism. You can look for the internet and for the literature to discover several characterizing properties. Hope this helps
Consider the case $R = \mathbb{F}_p[x]$, then clearly, there is no polynomial $f$ such that $f^p = x$, thus $a \mapsto a^p$ is not surjective, although $R$ is a domain.
But you are right that is is injective if $R$ is domain.