You have several errors in defining the function prof.
First of all, in order to make the function applicable to its variable in that way prof[p], then you need to define it in the following way
prof[p_] := p n^(sigma - 1) y p^-sigma (p - c);
notice that there is a space between p and n which indicate a multiplication, without the space pn will be considered as a new variable.
Then you can proceed with the differentiation and solving
Solve[{D[prof[p], {p}] == 0}, p]