I always stop to offer my help, parts, tools.
I ask if they want to do it or have me do it (The latter is a lot quicker, IMHO).
Oddly, I can't remember a time when passing cyclists asked me if I needed help when I was in the midst of a repair. It's always the passing cars that ask if I need help and usually offer a ride!