At the time that Democrats began paying for the research, Mr. Trump was in the process of clinching the Republican presidential nomination, and Ms. Clinton's allies were scrambling to figure out how to run against a candidate who had already weathered attacks from Republican rivals about his shifting policy positions, his character and his business record.