Fragmentation function of non-prompt J/psi-tagged charged jets