I am looking into various one way functions and I stumbled upon a Rabin function, which is squaring modulo an RSA modulus $N=pq$, where $p,q$ are prime: $R_N(x) = x^2 \mod N$.
Would it lose the one-way property if $N$ is prime and not a product of two primes?
UPD: Also, is Rabin function still one-way if factorization of $N=pq$ is known?