Length Preserving One way function In the proof of existence of length preserving one way functions assuming the existence of one way functions, see

Length-preserving one-way functions

We need $p(n)$ to be a function which can not only be computed in polynomial time, but also, its inverse should be polynomial time computable. How do we ensure that ? $p(n)$ can be chosen to be monotonically increasing. But is that sufficient ?
$p(n)$ is just a polynomial that indicates the length of the output of the function $g$, as a function of the length of the input.  Imagine that it's something like $27n$ or $2n^2$, and then read through the proof and you'll see how it works.

I didn't see any requirement to compute an inverse of $p(\cdot)$ in that proof.  I'm not sure where you got that from.  But anyway, if you wanted to invert it, any such polynomial is monotonic and can be easily inverted, e.g., by using binary search or using Newton's method.