Direct Sum Exercise Let $E$, $F$ be two vector spaces on the field $\mathbb K$. We define two linear functions
$$f:E\longrightarrow F$$
$$ g:F\longrightarrow E$$
such that .
$$f\circ g\circ f=f, \hspace{0.5cm}\text{ and }\hspace{0.5cm} g\circ f \circ g=g.$$
Prove that
$$E=\text{Im}(g)\oplus\text{Ker}(f)\hspace{0.5cm}\text{ and }\hspace{0.5cm}F=\text{Im}(f)\oplus\text{Ker}(g).$$
My Attempt
I don't know how to start with this problem. I know that the definition of a direct sum means that first, for every $x\in E$, we have $x=u+v$, where $u\in\text{Im}(g), v\in\text{Ker}(f)$, and $\text{Im}(g)\cap\text{Ker}(f)=\{0_E\}.$
Since $v\in\text{Ker}(f)$, then $f(v)=0$. By using the first property and the linearity of both $f$ and $g$, we get that
$$f(g(f(u+v)))=f(g(f(u)+f(v)))=f(g(f(u)))\overset{\Delta}{=}f(u).$$
I also see that somehow, $f$ and $g$ are inverse functions.
I'm just confused at what I should do first...
 A: It's easy to see that $gf\circ gf=gf.$ Then $gf\colon E\to E$ is idempotent.   Therefore we get $$E=\mathrm{Im}\, gf\oplus \ker gf.$$ We show $\mathrm{Im}\, gf=\mathrm{Im}\, g$ and $\ker gf=\ker f.$
Since $gf\circ g=g$ and property of idempotent transformation, we get $\mathrm{Im}\, g\subseteq \mathrm{Im} gf.$ It implies $\mathrm{Im}\, gf=\mathrm{Im}\, g.$
If $\alpha \in \ker gf,$ then $0=f\circ g\circ f\alpha=f\alpha.$ It implies $\ker gf=\ker f.$
A: Let's prove $E=\operatorname{Im}(g)\oplus\ker(f)$, the other being similar. We have to show

*

*that $\ker(f)\cap Im(g)=0$, and

*every $v\in E$ writes as the sum $u+w$ with $u\in \ker(f)$ and $w\in Im(g)$.

$1)$ let $v\in\ker(f)\cap Im(g)$, then $f(v)=0$ and there is $w$ so that $v=g(w)$, but now $0=g(0)=g(f(v))=g(f(g(w))=g(w)=v$, so $v=0$ q.e.d.
$2)$ By linearity, from $f(g(f(v)))=f(v)$ we deduce $f(v-g(f(v)))=0$. Therefore forall $v\in E$ we have $v-g(f(v))\in\ker(f)$. Thus $v=v-g(f(v))+g(f(v))$, and setting $u=v-g(f(v))$, $w=g(f(v))$ we have $v=u+w$ as required.
