I was listening to a talk about ultraproducts and one result there suggested, that every finitely generated group can be written as a colimit of residually finite groups (over a directed system). As I don't see a trivial proof, I expect it to be false (it is a statement about all groups). But I don't see a counterexample.

1$\begingroup$ For context, these are called LEF groups. LEF means "locally embeddable in finite" (groups). Such a notion makes sense for much more general algebraic structures, see Malcev's book "algebraic systems"; in the context of groups it was later specified by Stëpin, and then VershikGordon. For finitely presented groups, LEF is equivalent to residually finite. $\endgroup$ – YCor Oct 22 '18 at 12:01
The answer is: This does not hold in general.
If the group in question is finitely generated, then the maps into the colimit will eventually be surjective. If the group in question is also finitely presented, then eventually, all relations will hold in the groups in the colimit diagram. Hence, you can split the surjection and see the colimit group as a subgroup of one of the groups in the diagram.
Hence, your assertion would imply that every finitely presented group is residually finite (since this property passes to subgroups), which of course is wrong. Higman's group is the classical counterexample:
$$H:= \langle a,b,c,d \mid ba = a^2b, cb=b^2c, dc=c^2d, ad=d^2a \rangle.$$
It has no finite quotients and is finitely presented.