I have a very easy question but I can't find the solution.
Let $V,U,W$ be three $\mathbb{R}$-vector spaces and let $f: V \rightarrow U$ be a surjective linear map and $g: V \rightarrow W$ a linear map. Now, define $h : U \rightarrow W$ such that $h \circ f =g$.
I want to know if $h$ is linear or not.
Let $u_1,u_2 \in U$ such that $u_1= f(v_1)$ and $u_2= f(v_2)$ and let $c \in \mathbb{R}$. Then,
\begin{equation} \begin{aligned} h(cu_1+u_2) &= h(cf(v_1)+f(v_2)) \\ &= h(f(cv_1+v_2)) \\ &=g(cv_1+v_2) \\ &=cg(v_1)+g(v_2) \\ &= c h(f(v_1))+h(f(v_2)) \\ &= c h(u_1) +h(u_2) \end{aligned} \end{equation}
Then, I want to conclude than $h : U \rightarrow W$ is linear.
But now, take $f$ and $g$ such that $\text{ker} (f) \neq \text{ker} (g)$ (and suppose the kernel are not reduce to $0$). Then, there exists $v \in V$ such that $v \in \text{ker} (f)$ and $v \not\in \text{ker} (g)$ and so
$$h(0) = h(f(v))=g(v) \neq 0$$ and so $h$ is not linear ...
Can you explain to me what the problem is with my reasoning? My first calculation tells me that in any case $h$ is linear but the second says that when $\text{ker} (f) \neq \text{ker} (g)$ then $h$ is not linear ...