I have a problem in understanding the proof a theorem/ lemma involving the subspace of codimension one and the kernel of a non-zero linear functional. I understand the first part of the proof but couldn't decipher the second part. Although it says "clearly", it is not for me. The statement and proof are as follows.
The kernel of a non-zero linear functional $f$ on a linear $X$ is a subspace of codimension one and a linear subspace $Z$ of codimension one is the kernel of a non-zero linear functional on $X$.
Proof.
For $x_0\in X\backslash ker(f)$, $f(x)\neq 0$ and for any $x\in X$, $$x=\frac{f(x)}{f(x_0)}x_0+y,\;\mathrm{where}\; y\in \ker(f).$$ This shows that $\ker(f)$ is a subspace of codimension one.
For $x_0\in X\backslash Z$, and $x\in X$ can be represented uniquely in the form $x=\lambda x_0+y$, where $\lambda$ is a scalar and $y\in Z$.
Define a function $f$ on $X$ by $f(x)=\lambda$. Then, clearly, $f$ is linear and $\ker(f)=Z$.
Here is my attempt to understand the second part:
For $x_0\in X\backslash Z$, and $x\in X$ can be represented uniquely in the form $x=\lambda x_0+y$, where $\lambda$ is a scalar and $y\in Z$.
Let $x_1,x_2\in X$ and $\lambda_1, \lambda_2$ be two scalars and choose $y_1,y_2\in Z$ . Then, they have unique representation as:
$$x_1= \lambda_1 x_0+y,\; x_2= \lambda_2 x_0+y.$$
Define a function $f$ on $X$ by $f(x)=\lambda$.
Now, $f(\alpha x_1+\beta x_2)=f((\alpha\lambda_1+\beta\lambda_2)x_0+\alpha y_1+\beta y_2)=f((\alpha \lambda_1+\beta \lambda_2)+y')$, where $y'=\alpha y_1+\beta y_2\in Z$ since $Z$ is a subspace. Then, $f(\alpha x_1+\beta x_2)=\alpha \lambda_1+\beta \alpha_2=\alpha f(x_1)+\beta f(x_2)$, which shows that $f$ is linear.
I have a problem proving that $Z=\ker(f)$. Any help appreciated.