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..

Let's say we have a homomorphism $\phi$ that satisfies $\phi(r)=r$ for $r \in R$ and $\phi(x)=k(x)$. We need to prove that this homomorphism equals your homomorphism above, which we can do simply by using the definition of homomorphisms and the values of $\phi$ that are given.
Consider $\phi(f(x))$:
$$\phi\left(\sum_{i=0}^n a_ix^i\right)$$
Distribute $\phi$ over the summation:
$$\sum_{i=0}^n\phi(a_ix^i)$$
Distribute $\phi$ over multiplication:
$$\sum_{i=0}^n\phi(a_i)\phi(x)^i$$
Substitute:
$$\sum_{i=0}^n a_i[k(x)]^i$$
Thus, using the definition of homomorphisms and the hypothesis, we were able to prove that any homomorphism satisfying the hypothesis needs to have the above definition. Since they all have the same definition, they are all equal and thus there is only one unique homomorphism satisfying the hypothesis.
