This is from Lawvere's Conceptual Mathematics.
Let $\mathbf{2}$ be a fixed 2-point set. Define the category $\mathbf{2/Set}$ of bipointed sets to have as objects the $\mathbf{Set}$ maps $\bar{x}\colon \mathbf{2} \to X$ and as maps the $\mathbf{Set}$ maps satisfying $f\bar{x} = \bar{y}$. Show that in $\mathbf{2/Set}$ the initial object is the identity map $\mathbf{1_{2}}\colon \mathbf{2} \to \mathbf{2}$.
Assume all sets are finite.
How can I show this? One way is to use specific properties of $\mathbf{Set}$-maps: There are only 4 maps from $\mathbf{2} \to \mathbf{2}$, and we can exclude the transposition (we could construct a counterexample to $f\bar{x} = \bar{y}$). Similarly we can exclude the maps that are not surjective, since then they wouldn't satisfy the uniqueness required of an initial object.
How can I do this more categorically? I'm thinking:
$ \matrix{2 & \overset{\bar{x}}\to & X \\ &{}_f\!\!\searrow & \ \ \uparrow \bar{x} \\ &&2 } $
I want to show that $f = \mathbf{1_2}$. This diagram says that for any $X$ and $\bar{x}$ we have $\bar{x}f = \bar{x}$. Since this holds for arbitrary $X$ and $\bar{x}$ I want to conclude that $f$ is the identity. Finally, I can conclude that $\mathbf{1_{2}}\colon \mathbf{2} \to \mathbf{2}$ is the initial object, because the identity is unique.
I don't think that considering arbitrary morphisms $\mathbf{2} \to \mathbf{2}$ is going to be very useful. For example, if $\bar x(0) = \bar x(1) \in X$, then you're going to have $\bar x \circ f = \bar x$ for all $f : \mathbf{2} \to \mathbf{2}$. (But this looks more like you're trying to work in the slice $\mathbf{Set}/\mathbf{2}$ rather than the coslice $\mathbf{2}/\mathbf{Set}$ anyway.)
I recommend just verifying the universal property directly.
Specifically, for each bipointed set $(X, \bar x : \mathbf{2} \to X)$, prove that there is a unique morphism $(\mathbf{2}, \mathrm{id}_{\mathbf{2}}) \to (X, \bar x)$ in $\mathbf{2}/\mathbf{Set}$:
Both of these follow pretty much immediately from the definition of what it means to be a morphism in $\mathbf{2}/\mathbf{Set}$.
The relevant diagram is: $$ \begin{array}{ccc} \mathbf{2} & \xrightarrow{\bar x} & X \\ {\scriptsize\mathrm{id}}\downarrow\phantom{\scriptsize\mathrm{id}} & \nearrow_{\exists!} & \\ \mathbf{2} \end{array} $$
Related: the assumption that all sets are finite is not necessary.