For any commutative ring $R,$ there is a unique homomorphism $f : \Bbb Z\to R,$ as specifying that $1\mapsto 1$ tells you where each element of $\Bbb Z$ must map to. Concretely, for any positive $n\in\Bbb Z,$ you have $n = 1 + \dots + 1$ ($n$ times,) so that $$f(n) = f(1 + \dots + 1) = f(1) + \dots + f(1) = n\cdot f(1).$$
You also know that $f(0) = 0,$ and if $n\in\Bbb Z$ is negative, then $f(n) = f(-(-n)) = -f(-n).$ Thus, there is exactly one morphism $f : \Bbb Z\to R,$ because the image of any element is determined by where $1$ is sent and the ring homomorphism rules.
Now, let's examine what it takes to define a morphism $\Bbb Z[x]\to R.$ We already know that we don't have a choice for where $\Bbb Z\subseteq\Bbb Z[x]$ is sent. What about $x$? Well, it turns out we can send $x$ to any element of $R$ that we want.
Suppose that $r\in R.$ If $f : \Bbb Z[x]\to R$ is a ring homomorphism sending $x$ to $r,$ then the ring homomorphism properties imply that we must have
\begin{align*}
f\left(\sum_{i = 0}^n a_i x^i\right) &= \sum_{i = 0}^nf\left( a_i x^i\right)\\
&= \sum_{i = 0}^n f(a_i) f(x^i)\\
&= \sum_{i = 0}^n f(a_i) f(x)^i\\
&= \sum_{i = 0}^n f(a_i) r^i.
\end{align*}
Every element of $\Bbb Z[x]$ is of the form $\sum_{i = 0}^n a_i x^i$ for some $n$ and some collection of integers $a_i,$ so we see that specifying where $x$ is sent determines the entire homomorphism. In particular, it is given by
$$
p(x) = \sum_{i = 0}^n a_i x^i \mapsto \sum_{i = 0}^n f(a_i) r^i = p(r).
$$
Conversely, setting $f(x) = r$ and extending in the above way is always a ring homomorphism. That is, let $r\in R$ and define
\begin{align*}
f : \Bbb Z[x]&\to R\\
\sum_{i = 0}^n a_i x^i &\mapsto \sum_{i = 0}^n g(a_i) r^i,
\end{align*}
where $g : \Bbb Z\to R$ is the unique ring homomorphism from paragraph one. We still have $f(1) = g(1) = 1$ and for any $n,m\in\Bbb Z\subseteq\Bbb Z[x],$ we have $$f(n + m) = g(n + m) = g(n) + g(m) = f(n) + f(m).$$ Suppose we have two arbitrary polynomials $\sum_{i = 0}^n a_i x^i,$ $\sum_{i = 0}^m b_i x^i.$ Then without loss of generality $m\leq n,$ and we can say that $\sum_{i = 0}^m b_i x^i = \sum_{i = 0}^n b_i x^i,$ where we define $b_j = 0$ for $j > m.$ Then we have
\begin{align*}
f\left(\sum_{i = 0}^n a_i x^i + \sum_{i = 0}^n b_i x^i\right) &= f\left(\sum_{i = 0}^n (a_i + b_i) x^i\right)\\
&= \sum_{i = 0}^n g(a_i + b_i)r^i\qquad\textrm{(by definition)}\\
&= \sum_{i = 0}^n \left(g(a_i) + g(b_i)\right)r^i\\
&= \sum_{i = 0}^n (g(a_i)r^i + g(b_i)r^i)\\
&= \sum_{i = 0}^n g(a_i)r^i + \sum_{i = 0}^n g(b_i)r^i\\
&= f\left(\sum_{i = 0}^n a_i x^i\right) + f\left(\sum_{i = 0}^n b_i x^i\right).
\end{align*}
You can check similarly that $$f\left(\left(\sum_{i = 0}^n a_i x^i\right)\cdot\left(\sum_{i = 0}^n b_i x^i\right)\right) = f\left(\sum_{i = 0}^n a_i x^i\right)\cdot f\left(\sum_{i = 0}^n b_i x^i\right),$$
so that the map defined is indeed a ring homomorphism.
The case of two variables is similar - a ring homomorphism is completely determined by where each variable is sent, and any choice of $r,s\in R$ gives a ring homomorphism with $x\mapsto r$ and $y\mapsto s.$
What's happening is that $\Bbb Z[x,y]$ is the free commutative ring on two generators $x$ and $y,$ which means essentially what I stated above - a ring homomorphism from $\Bbb Z[x,y]$ is given by a choice of where $x$ and $y$ will be sent, and any choices will work. To make sure that this defines a map on the quotient you want, you need to further specify that the images of $x$ and $y$ satisfy the given relation - i.e., because $x^3 + y^2 - 1 = 0$ in $\Bbb Z[x,y]/(x^3 + y^2 - 1),$ we must have $f(x)^3 + f(y)^2 - 1 = 0$ as well.
Best Answer
You are right it is unique, basically for the reasons you gave. However, it is not "the identity map" as the term is usually understood. For example note that when $R$ is finite, such as $R = \mathbb{Z}/n \mathbb{Z}$, your map certainly cannot even be injective.
What is true, and maybe you meant this, is that for each $n \in \mathbb{Z}$ you necessarily have $\phi(n)= n \cdot 1_R$.
To complete you argument you should consider negative integers too, and depending on how formal you want to be give a proof for the general case for positive $n$ via induction.