I understand that:
$X\perp Y$, for any $x$ and any $y$, $x\perp y$.
Then $P(X=x) = P(X=x|Y=y)$.
But I am struggling on giving a reason how $x^2\perp y^2$.
I understand that:
$X\perp Y$, for any $x$ and any $y$, $x\perp y$.
Then $P(X=x) = P(X=x|Y=y)$.
But I am struggling on giving a reason how $x^2\perp y^2$.
You don't really want to work with something like $P(X=x|Y=y)$ in general because it is possible that $P(X=x) = 0$ and $P(Y=y)=0$ for all $x,y \in \mathbb{R}$, e.g. if $X$ and $Y$ are both normally distributed. It's usually easier to work with the CDFs of $X$ and $Y$.
One property equivalent to $X \perp Y$ is $P(X \le x, Y \le y) = P(X \le x)P(Y \le y)$ for all $x,y \in \mathbb{R}$. So to show $X^2 \perp Y^2$, we can show $P(X^2 \le x, Y^2 \le y) = P(X^2 \le x)P(Y^2 \le y)$ for all $x,y \in \mathbb{R}$. If either $x$ or $y$ is negative, both sides will be $0$, so we just need to handle the case $x \ge 0$ and $y \ge 0$. Then we have \begin{align*} P(X^2 \le x, Y^2 \le y) &= P(|X| \le \sqrt{x}, |Y| \le \sqrt{y}) \\ &= P(X \le \sqrt{x}, Y \le \sqrt{y}) \\ &= P(X \le \sqrt x)P(Y \le \sqrt y) \\ &= P(X^2 \le x)P(Y^2 \le y), \end{align*} where we used that $X$ and $Y$ are non-negative to conclude $|X| \le \sqrt x$ iff $X \le \sqrt x$.