The truth of the claimed statement hinges on the precise definition of 'dominant', of which there are two variations:
1) Topologically dominant: $f(X)$ is topologically dense in $f(Y)$. This is not enough for the statement to be true - consider, for a field $k$, the morphism $$k[T]/(T^2) \to k$$
which is a surjective ring homomorphism inducing a homeomorphism on underlying topological spaces of the associated affine schemes. More generally, any nilimmersion will give you a counterexample.
2) Scheme-theoretically dominant: $Y$ is the scheme theoretic image of $f$. By definition, the scheme theoretic image $Z$ of a morphism $f: X \to Y$ is the initial closed subscheme of $Y$ over which $f$ can be factored. In other words, whenever you factor $f$ into $X \to Z' \to Y$ with $Z' \to Y$ a closed immersion, you get a unique factorization $Z \to Z' \to Y$ of the inclusion $Z \to Y$.
If you use this definition, your statement is true, albeit somewhat tautological. In fact, for a morphism $f: X \to Y$ of affine schemes, coming from $\phi: R \to A$, the scheme theoretic closure is given by $Spec(R/ker(\phi)) \to Spec(R)$ (the universal property is just the isomorphism theorem). Hence, for a morphism of affine schemes, being scheme theoretically dominant is always equivalent to being injective on the level of rings (without assumption on surjectivity).