How can I show the uniqueness of homomorphism? Let $R$ be a commutative ring and let $k(x)$ be a fixed polynomial in $R[x]$.
Prove that there exists a unique homomorphism $\varphi:R[x]\rightarrow R[x]$ such that
$\varphi(r)=r\;\mathrm{for\; all\;}r\in R\quad\mathrm{and}\qquad\varphi(x)=k(x)$
and I found such ring homomorphism as follows:
For any $f(x)=\sum_{i=0}^{n}a_{i}x^{i}\in R[x]$, 
 define  $\varphi(f(x))=\sum_{i=0}^{n}a_{i}\left[k(x)\right]^{i}$
Then I can easily show that $\varphi(r)=r$  $\mathrm{and}$ $\varphi(x)=k(x)$
But it's hard for me to prove the uniqueness..

If $\phi:R[x]\to S$ is ringhomomorphism then it induces a ringhomomorphism $\psi:R\to S$ that is prescribed by $r\mapsto\phi(r)$. 
This ringhomomorphism $\psi$ together with value $\phi(x)\in S$ determines $\phi$. 
This because:
$$\phi(a_0+a_1x+\cdots a_nx^n)=\psi(a_0)+\psi(a_1)\phi(x)+\cdots+\psi(a_n)\phi(x)^n$$
In your case $S=R[x]$, $\psi(r)=r$ and $\phi(x)=k(x)$.
