I'm trying to show $R[x,y]\cong R[x][y]$ using the following proposition:
Let $\varphi:R\to R'$ be a ring homomorphism. Given $\alpha_1,\alpha_2,\cdots,\alpha_n\in R'$, there exists a unique homomorphism $\Phi:R[x_1,x_2,\cdots,x_n]\to R'$ such that $ \Phi|_{R}=\varphi, \quad \Phi(x_i)=\alpha_i,i=1,2,\cdots,n. $
Consider the inclusion map $f:R\to R[x][y]$ which is a homomorphism. By the proposition above, there is a unique homomorphism $g:R[x,y]\to R[x][y]$ such that $ g|_R=f $ and $g(x)=x$, $g(y)=y$. It suffices to show that $g$ is a homomorphism. Instead of showing that $g$ is 1-1 and onto, I'm trying to construct an inverse of $g$. Consider the inclusion map $h:R[x]\to R[x,y]$. Using the proposition again, we have a unique homomorphism $l:R[x][y]\to R[x,y]$ such that $ l_{R[x]}=h $ and $l(y)=y$. It follows that we have a homomorphism $ l\circ g:R[x,y]\to R[x,y] $ such that $ l\circ g|_{R}=id_{R[x,y]}|_R $ and $l\circ g(x)=x$, $l\circ g(y)=y$. We also have a similar argument with $ g\circ l: R[x][y]\to R[x][y]. $
I've only shown that $l\circ g$ agrees with the identity map $id_{R[x,y]}$ on $R$ and $\{x,y\}$. My question:
How can I show that $l\circ g$ is the identity map $id_{R[x,y]}$? (Then similarly, I would be able to show $g\circ l=id_{R[x][y]}$).
[EDIT:] I saw a proof in Artin's Algebra, but I didn't understand how the underscored sentence works.