Questions about profit function
You're probably confusing two things: the objective function $pf(x) - wx$ being used in profit maximization problem: $\max pf(x) - wx$, the objective function is concave in $x$ and thus, you can solve the maximization problem. However, a profit function $\pi(p,w)$ being a result of maximization problem identifies the maximum profit given level of prices and wages $\pi^*(p,w)$ (and it's convex in $p$ and $w$ as you said).