For the claim to be true you need the additional hypothesis that $p$ is $\Bbb{R}$-linear.

An $\Bbb{R}$-linear ring homomorphism $$p: \Bbb{R}[X] \longrightarrow\ \Bbb{R}[X]$$ is determined by where it maps $X$. It follows immediately from the ring axioms that $p=\phi_{p(X)}$. Indeed, if $p$ is $\Bbb{R}$-linear then $p(r)=r$ for all $r\in\Bbb{R}$, and your algebraic manipulations show that then $$p(f)=f(p(X))=\phi_{p(X)}(f),$$ for all $f\in\Bbb{R}[X]$. To see that the $\Bbb{R}$-linear automorphisms are precisely the linear maps $p$ for which $p(X)$ is linear, note that $\deg p(f)=\deg p(X)\cdot\deg f$ for all $f\in\Bbb{R}[X]$, so for $p$ to be surjective we must have $\deg p(X)=1$. Check that $\phi_g$ is invertible for all linear $g$.