Let $R$ be a commutative ring. I have to show that for any $a,b\in R$, there exists a unique ring homomorphism $f:R[X]\to R[X]$ such that $f(c)=c$ for all $c\in R$ and $f(X)=aX+b$.
I am not getting how to start. Should I start with ideal generated by $X$? Any suggestion will be appreciated.
As Julian Mejia states, you can consider how $f$ behaves on an arbitrary polynomial, i.e. element of $R[X]$, and see that it is completely determined by how it behaves on $X$ and on the coefficients just by being a ring homomorphism.
A slightly more advanced perspective on this is to notice that the $f(r)=r$ for $r\in R$ condition means $f(rp)=f(r)f(p)=rf(p)$. This in turn means that $f$ is not just a ring homomorphism but an $R$-algebra homomorphism. $R[X]$ is the free commutative $R$-algebra on one generator, namely $X$. Its universal (and often defining) property is that any $R$-algebra homomorphism $R[X]\to A$, for $A$ any other commutative $R$-algebra, is entirely determined by where it sends the generator, $X$. It is easy to verify this property using the ideas mentioned in the first paragraph.