Say I have a function $f$. Then, if I understand correctly, $f$ can be regarded as a morphism in a suitably chosen category which has the domain of $f$ and the range of $f$ as objects.


So, the other direction. Say I have a morphism $f$ in some category from one object $A$ to another object $B$. Can I not regard $f$ as a function whose domain is $\{A\}$ and range $\{B\}$?


I'm interested in looking for contexts in which the latter move is not appropriate for some reason.



What is the difference between a function and a morphism?
You're losing a lot of information. Let's say we have two morphisms $f,g\in \mathrm{Hom}(A,B)$. Using your perspective, we see that both $f$ and $g$ agree at all points (as the only point is $B$). Thus by eta-reduction we should have $f=g$, but this is not necessarily the case. So thinking of morphisms as functions from $\{A\}$ to $\{B\}$ is the wrong perspective.


