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..
 A: 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.
A: (Note: all rings involved are unital)
This is a special case of $R[x]$ being free commutative $R$-algebra over one element. I will explain precisely what I mean and if you never heard of the concept, think of vector spaces: you can define unique linear operator just by setting the values on a base and extending by linearity. This is pretty much the same.

Claim: Let $A$ be a commutative $R$-algebra ($R$-module that is a ring) and let $a\in A$. Then there is a unique algebra homomorphism
  $\varphi\colon R[x]\to A$ ($R$-linear map that is multiplicative) such
  that $\varphi(1) = 1$, $\varphi(x) = a$.

Proof. We define $\varphi$ precisely how you did it: $$\varphi(\sum r_nx^n) = \sum r_n a^n$$ It's straightforward verification that this is $R$-linear and multiplicative. Let $\psi\colon R[x] \to A$ be algebra homomorphism such that $\psi(1) = 1$, $\psi(x) = a$. Then we have $$\psi(\sum r_nx^n) = \sum\psi(r_nx^n)=\sum r_n\psi(x)^n=\sum r_na^n = \varphi(\sum r_nx^n)$$ and thus the uniqueness is proved.
To get your claim, set $A=R[x]$ and $a = k(x)$.
A: 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)$.
