I am studying linear categories and there is a problem I cannot solve. How do I show that a section $f : X\to Y$ (i.e, a map such that there is $g : Y \to X$ satisfying $g\circ f = 1_X$) is a kernel?
I tried a lot of things, such as keeping in mind that for any object $Z$, $0 : Z\to X$ is a kernel for $f$, but could not construct a map $h : Y \to Z$ such that $f$ is a kernel for $h$. How can I solve it?


Intuition: This is easier to figure out if you have a picture of what a section should look like in your head. I think a good picture is the following geometric picture of a section (taken from Wikipedia):
Here, $p$ is the projection of the elements of $E$ onto $B$ (sending each element of $E$ to the element of $B$ directly under it), and $s$ is a section of $p$ -- i.e., a [continuous] choice for each element of $b\in B$ of an element living directly over it in $E.$
Now $\mathsf{Top}$ isn't an additive category, so the following won't literally make sense, but it will be helpful to have the topological picture in your head while thinking algebraically. If we want to find a morphism whose kernel is $s,$ we want a morphism that will destroy precisely the black subspace of $E$ (i.e., the image of $s$). Notice that the composition $s\circ p$ sends every element of $E$ to the unique element of $s(B)$ directly over or under it. Then "$s\circ p - \operatorname{id}_E$" will kill precisely the elements fixed by $s\circ p,$ which are exactly the elements in $s(B).$
We can check our intuition by looking at an algebraic example. Suppose that we start with the morphism $g : \Bbb{Z}\times\Bbb{Z}\to\Bbb{Z}$ defined by $g(m,n) = m+n.$ This has a section $f : \Bbb{Z}\to\Bbb{Z}\times\Bbb{Z}$ given by $f(n) = (n,0).$ We can easily compute $$(f\circ g - \operatorname{id}_{\Bbb{Z}\times\Bbb{Z}})(n,m) = (n+m,0) - (n,m) = (-m,m),$$ and it is also simple to verify that the kernel of this morphism are precisely the elements where $m = 0.$
Verification of intuition: Let $h = f\circ g - \operatorname{id}_Y : Y\to Y.$ First, let's do a sanity check to make sure $f$ has a chance of being the kernel of $h$ -- let's check that $h\circ f = 0.$ \begin{align*} h\circ f &= (f\circ g - \operatorname{id}_Y)\circ f\\ &= f\circ g\circ f - f\\ &= f\circ\operatorname{id}_X - f\\ &= 0. \end{align*} This gives us a candidate for $h.$
Now we need to show that $f : X\to Y$ has the desired universal property. So, suppose that we have another morphism $f' : X'\to Y$ such that $h\circ f' = 0.$ First, we need this $f'$ to factor through $f$ in the first place. We can find a map $X'\to X$ by using the map $g : Y\to X$ to get back from $Y$ to $X$; that is, we have a map $X'\to X$ given by $X'\xrightarrow{f'} Y\xrightarrow{g}X.$ Now, does this make the relevant diagram commute? In other words, do we have $f\circ g\circ f' = f'$? Well, since we're in an additive category, this is the same as asking if $f\circ g \circ f' - f' = 0.$ But $$f\circ g\circ f' - f' = (f\circ g - \operatorname{id}_Y)\circ f' = h\circ f',$$ which was $0$ by assumption.
We must finally show that given two maps $\alpha,\beta : X'\to X$ such that $f\circ\alpha = f\circ\beta = f',$ we have $\alpha = \beta.$ However, this is a direct consequence of the section property: \begin{align*} f\circ\alpha &= f\circ\beta\\ \implies g\circ f\circ\alpha &= g\circ f\circ\beta\\ \implies \alpha &= \beta. \end{align*}