Prove if $x\equiv y \pmod{n}$ then $x^2y\equiv xy^2\pmod{n}$ where $x,y,n \in \mathbb{N}$
Proof
$x\equiv y \pmod{n}\Rightarrow n|x-y\Rightarrow n|xy(x-y)=x^2y-y^2x \Rightarrow x^2y\equiv yx^2\pmod{n}$
Is correct use this proof?
Prove if $x\equiv y \pmod{n}$ then $x^2y\equiv xy^2\pmod{n}$ where $x,y,n \in \mathbb{N}$
Proof
$x\equiv y \pmod{n}\Rightarrow n|x-y\Rightarrow n|xy(x-y)=x^2y-y^2x \Rightarrow x^2y\equiv yx^2\pmod{n}$
Is correct use this proof?
On
Yes, it looks fine.
$$x \equiv y \pmod n$$
implies that we can switch $x$ and $y$ in terms of $\pmod n$.
$$\color{blue}x^2\color{green}y \equiv \color{blue}y^2\color{green}x \pmod n$$
Actually we do have
$$\color{blue}x^2\color{green}y \equiv x^3 \equiv y^3 \equiv \color{blue}y^2\color{green}x \pmod n$$
Your proof seems good. Just for variety,
Noting $xa\equiv ax \bmod n$, then taking $a=xy$:
$x\equiv y \bmod n \implies x\cdot xy \equiv xy\cdot y \bmod n$ as required.