Fragmentation function of prompt J/psi-tagged charged jets