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 ?