Given $A \overset{f}{\to}B$, what measures how hard it is to factor through $f$? Suppose $A \overset{f}{\to} B$ is a morphism in a category (say for ease they are abelian groups). When we consider other morphisms out of $A$ (say to a  fixed object $C$), suppose we ask which maps $A \overset{g}{\to} C$ factor as $A \overset{f}{\to} B \overset{\tilde{g}}{\to} C$. 
Here are the ways I've seen this problem addressed in the past. What bothers me is that they focus on $C$ and $B/A$ rather than on $A$, $B$, and $f$. Perhaps someone can explain to me why that is, or how we can address this problem more generally.


*

*In case $f$ has a left inverse, it is clear that all maps out of $A$ factor through $f$. (Edit: If and only if, as E. Wofsey points out)

*If $f$ is not injective, the only maps $g$ that can possibly factor through $f$ are those that are zero on $\operatorname{ker}f$, and so we may as well replace $A$ with $A/\operatorname{ker}f$ and consider that $f$ is injective. Now $f$ fits into a short exact sequence, and "lack of ability to factor through $f$" is just the failure of $\operatorname{Hom}(\bullet, C)$ to be right exact.  In the particular case that $A$ and $B$ are free, this lack of exactness is represented by $\operatorname{Ext}^1_{\mathbb{Z}}(B/A, C)$.  

*If $C$ is an injective object, any map $A \to C$ factors through $f$.


But it seems like there should be a notion of "how much factorization through $f$ fails" intrinsic to $A$, $B$, and $f$, without necessarily referencing particular objects $C$. This is not to say that the object $C$ becomes irrelevant--of course it will matter what you are hom'ing into. But shouldn't there be something more to say about the ability to factor through $f$ that is intrinsic to $A$, $B$, and $f$? That is, something more than "does not have a left inverse"? 
How can we address this question?

Aside: This came up when I was thinking about the long exact sequence in relative cohomology, particularly thinking about exactness at the middle term of  $H^{k+1}(X,A) \overset{\delta}{\leftarrow} H^{k}(A) \leftarrow H^{k}(X)$. There are other issues here, such as which maps vanish on boundaries of simplices in $A$ versus the stronger condition of which maps vanish on all boundaries of simplices in $X$ whose boundary is contained in $A$.
 A: In an abelian category, the failure of a map $f:A\to B$ to have a left inverse can be measured by two obstructions together.  The first obstruction is $\ker(f)$: if $f$ is to have a left inverse, $\ker(f)$ must be $0$, and in general, the larger $\ker(f)$ is, the fewer maps there are that can factor through $f$.  Assuming $\ker(f)=0$, the second obstruction is the element of $\operatorname{Ext}^1(\operatorname{coker}(f),A)$ given by the exact sequence $0\to A\to B\to\operatorname{coker}(f)\to 0$ (via the correspondence between Ext classes and extensions, as described here; alternatively, it is just the obstruction in $\operatorname{Ext}^1(B/A,C)$ you mentioned in the question in the case where $C=A$ and $g$ is the identity map).  This Ext class vanishes iff the sequence splits, i.e. iff $f$ has a left inverse.  More generally, even if the first obstruction $\ker(f)$ does not vanish, you can still define the second obstruction as an element of $\operatorname{Ext}^1(\operatorname{coker}(f),\operatorname{im}(f))$; this obstruction vanishes iff every map vanishing on $\ker(f)$ factors through $f$.
A: I wanted to summarize part of Eric Wofsey's excellent answer above, and expand a little. 
Given a map $A \overset{f}{\to} B$, assuming it is injective, the obstruction to its having a left inverse is its possible non-zeroness in $\operatorname{Ext}(B/A, A)$. That is, extend $f$ to a short exact sequence
$$0 \to A \to B \to B/A \to 0$$
which represents an element of $\operatorname{Ext}(B/A, A)$. If it is nonzero in $\operatorname{Ext}(B/A, A)$, we know that there are some maps $A \to C$ that won't factor through $f$ (in particular, if $C=A$ and $A$ is the identity, then it won't factor through $f$, since this would imply a splitting morphism $B \to A$ which would mean that our above short exact sequence split, but we have assumed we are looking at a nonzero element of $\operatorname{Ext}(B/A, A)$).
But, of course, still some $A \overset{g}{\to} C$ might factor through $f$. The map $g$ will factor through $f$ exactly when our exact sequence is in the kernel of the map $\operatorname{Ext}(B/A, g): \operatorname{Ext}(B/A, A) \to \operatorname{Ext}(B/A, C)$. 
(I claim that the existence of a map $B \overset{\tilde{g}}{\to} C$ such that $\tilde{g} \circ f = g$ is equivalent to a splitting morphism from $D \to C$, where 
$$0 \to C \to D \to D/C \to 0$$
is the image of our exact sequence under $\operatorname{Ext}(B/A, g)$. Note that $D$ is the pushout of $f$ and $g$.)
In particular, if $C$ is injective, then everything is in the kernel of $\operatorname{Ext}(B/A, g): \operatorname{Ext}(B/A, A) \to \operatorname{Ext}(B/A, C)=0$.
