I have tested a lot of combinations with integer numbers and it seems like we can say that $y^2 \bmod n$ equals $((y \bmod n)^2) \bmod n$.
I can't find any resource that acknowledges this. Is my statement correct? If no, what are the corner cases, if yes, can you explain why?