In the proof of existence of length preserving one way functions assuming the existence of one way functions, seeLength-preserving one-way functionsWe 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 ? 
Length Preserving One way function
complexity theory;one way functions