To be more specific with Gura Gura Man's (correct) answer, this is how it works.
The game uses 5 different formulas to evaluate a player's salary based on his skills, one for each role. Each formula weights the skills differently, so for example a player with very high Passing and Handling skills will have a high PG salary, but a low C or PF salary if his inside skills are not at the same level.
After calculating the 5 different salaries, the game picks the highest one, and that becomes the real player's salary, while the specific formula that generated it determines his natural role. The salaries are re-evaluated weekly, even if the "official" salary is only updated in the offseason, so that's why you may see a role update at any time.
So, really, the role you see in a player's profile is just an indication, or, if you want, a side-effect of the salary calculation system. Besides, the formulas used by the game are somewhat questionable... for example, Inside Shot has a very very low (close to 0) weight for SFs, which doesn't really make much sense, even more so if you play an inside oriented offense. Of course this is a circumstance that you may also exploit, or at least take into account when you decide what or who to train. In the previous example, training Inside Shot for a SF will improve his performance without a huge hit on his salary.