kernel of k-homomorphism

Let's $f_1,\ldots,f_m \in k[x_1,\dots,x_n]$ and the $k$-algebra homomorphism:

$$g:k[x_1,\ldots,x_n,y_1,\ldots,y_m] \rightarrow k[x_1,\ldots,x_n]$$ that sends $y_i \mapsto f_i$ and $x_j \mapsto x_j$

How can I prove that $\ker(g)= ( y_1-f_1,\ldots,y_m-f_m )$?

I tell what I've done:

$(\supseteq)$ If $a\in ( y_1-f_1,\ldots y_m-f_m )$ then $a=\sum _{i=1}^m \alpha_i(y_i-f_i)$. Hence $g(x)=\sum _{i=1}^m \alpha_i(g(y_i)-g(f_i))$ Since $g$ is a $k$-algebra homomorphism, we can conclude that $\sum _{i=1}^m \alpha_i(f_i-f_i)=\sum _{i=1}^m 0.\alpha_i=0$. So $a\in \ker(g)$.

Could anyone tell me if what I've done is right an help me with the other inclusion, please?

Thanks for any help

Let $R$ be a commutative ring (e.g. $K[X_1,\dots,X_n]$), $a_1,\dots,a_m\in R$, and $F\in R[Y_1,\dots,Y_m]$. Then one can write $$F(Y_1,\dots,Y_m)=(Y_1-a_1)G_1(Y_1,\dots,Y_m)+(Y_2-a_2)G_2(Y_2,\dots,Y_m)+\cdots+(Y_m-a_m)G_m(Y_m)+r,$$ where $r\in R$.
Now, if $\varphi:R[Y_1,\dots,Y_m]\to R$ is the $R$-algebra homomorphism which sends $Y_i$ to $a_i$ it's trivial to show that $\ker\varphi=(Y_1-a_1,\dots,Y_m-a_m)$.