Let $f$ be defined as follows
$$f: \Bbb Q \to \Bbb Q$$
$$f(x) = x^2$$
Show that $f(ℕ) ∩ ℕ = f(\Bbb Q) ∩ ℕ$
My attempt at solving this:
$$f(ℕ) ∩ ℕ = \{y \in \Bbb N \quad | \quad y = x^2, \quad x \in \Bbb N\}$$
$$f(\Bbb Q) ∩ ℕ = \{y \in \Bbb N \quad | \quad y = x^2, \quad x \in \Bbb Q\}$$
So it is sufficient to show that
$$\frac{p}{q} \in \Bbb N \iff \left(\frac{p}{q}\right)^2 \in \Bbb N$$
By definition it follows that
$$\frac{p}{q} \in \Bbb N \iff p = q \cdot l \qquad p,q,l \in \Bbb N \quad q \neq 0$$
I also found out that $$\left(\frac{p}{q}\right)^2 \in \Bbb N \iff p^2 = q^2 \cdot l^2$$ (the value of $l$ stays the same, do I have to prove this?)
So $q \cdot l - p = 0 \iff q^2 \cdot l^2 - p^2 = 0$? And if so, how to proceed?
Am I on the right track?
if $$\frac{p}{q}$$ is a natural number then it must be $$\frac{p}{q}=m$$ and $m$ is a natural number, then we get by squaring $$p^2=q^2m^2$$ and $$\frac{p^2}{q^2}=m^2$$ is a natural number. if $$\frac{p^2}{q^2}=m^2$$ then we have $$p^2=q^2m^2$$ or $$(p-qm)(p+qm)=0$$ from here we get $$\frac{p}{q}=m$$ and this is a natural number.