Ok, I wasn't being very accurate. More correctly, we do not know why outer stars in the galaxy rotate at the same speed as inner stars. As per gravitation laws, the farther the star is, the slower it should rotate. But they all rotate at the same speed, which only adds up if you assume there is some "dark matter" around the outside of the galaxy.
I honestly do not know how they estimate stellar masses. I suspect they just look at density of stars and have perhaps established that stars are more or less distributed randomly, but I'm armchairing here. Maybe an expert can chime in.
>As per gravitation laws, the farther the star is, the slower it should rotate.
That depends. The 1/R orbital speed relationship is valid only in cases of spherically symmetric mass distribution or when the radiuses of the interacting masses being much smaller than the distance between them. Neither of these is true for a star inside a galaxy disk. Correctly accounting for the disk shape gives you expected orbital speed much closer to the "outer stars in the galaxy rotate at the same speed as inner stars", though not exactly equal. The remaining difference is explained by the seond factor.
That second factor is that "rotate" i suppose means orbiting around galaxy center. The stars in the disk aren't really orbiting, ie. they are actually flying away like in a fireworks wheel as the galaxy disk becomes larger and thinner - exactly because the stars' speed is still somewhat higher than the orbital speed as calculated above. Thus no need for DM here.
I honestly do not know how they estimate stellar masses. I suspect they just look at density of stars and have perhaps established that stars are more or less distributed randomly, but I'm armchairing here. Maybe an expert can chime in.