Let $\mathbb{K}$ be a field, $x_1, x_2, x_3\in \mathbb{K}$ and $I:=\left \{f\in \mathbb{K}[x]\mid f(x_1)=f(x_2)=f(x_3)=0\right \}$.
I want to show that $I$ is an ideal of $\mathbb{K}[x]$.
So we take $f,g\in I$ and we want to show that $f-g\in I$, right?
Since $f,g\in I$ we have that $f,g\in \mathbb{K}[x]$ such that $f(x_1)=f(x_2)=f(x_3)=g(x_1)=g(x_2)=g(x_3)=0$.
Then we consider the sum. Can we just say that $f-g\in \mathbb{K}[x]$ ?
We also have that $$(f-g)(x_1)=f(x_1)-g(x_1)=0-0=0 \\ (f-g)(x_2)=f(x_2)-g(x_2)=0-0=0 \\(f-g)(x_3)=f(x_3)-g(x_3)=0-0=0$$
Then we take also a $g\in \mathbb{K}[x]$ and $f\in I$ and we want to show that $gf\in I$.
Can we just say that $gf\in \mathbb{K}[x]$ ?
We also have that $$(gf)(x_1)=gf(x_1)=g0=0 \\ (gf)(x_2)=gf(x_2)=g0=0 \\(gf)(x_3)=gf(x_3)=g0=0$$
Is everything correct and complete?
From that it follows that $I$ is an ideal of $\mathbb{K}[x]$, right?
Alternatively, $I$ is the kernel of the ring homomorphism $\phi : K[x] \to K^3$ given by $\phi(f)=(f(x_1),f(x_2),f(x_3))$.