Definition using elementhood test $\{1,4,9,16, \ldots \}$ Best way? I am working through "How to prove it: a structured approach".

4.Write definitions using elementhood tests for the following sets:
a) $\{ 1,4,9,16,25,36,49,\ldots \}$

For a. my first intuition was $\{x ∈ \Bbb{N}\ |\ x^2\}$ but then I realized it would not constitute a "test". So my question is what is the best way to express such a thing mathematically?  My best attempt so far is $\{x | \sqrt{x} ∈ \text{positive integers}\}.$
Second point of confusion is on some website I found this answer which seems to introduce free variable $y$ making it true or false depending which $y$ is chosen.  Basically if this following answer is correct, then I am REALLY confused.
$\{x ∈ \Bbb{R}\ |\ x = y^2 \text{ for some } y ∈ \Bbb N\}.$
 A: You have it backwards.  It's $\{n^2 \mid n\in\mathbb{N}\}$.
The notation $\{ A\mid B\}$ means the set of all things $A$ such that $B$ is true.
$\{x ∈ R \mid x = y^2\text{ for some }y ∈ \mathbb{N}\}$ is also OK.  One can say, for example, that $9=y^2$ for some $y\in\mathbb{N}$ because $9=3^2$.  Likewise $16=y^2$ for some $y\in \mathbb{N}$ because $16=4^2$, etc.
A: There's more than one way to specify your set - as such there's no single correct answer.
ncmathsadists's answer ($\{n^2|n\in\mathbb{N}\}$) shows the most common and useful notation, but I'm unsure whether it constitutes a test in the sense of your book.
Your answer involving the square root is fine as well, but as you will have noticed, it's not a great way to express the set as it obscures it rather than illustrating it.
The introduction of the free variable as in the second part in your is not necessary in everyday writing, but it comes in handy sometimes. Not everything imaginable that you can write between curly brackets makes sense as a set, see Russell's paradox. Mathematicians have studied these issues and came up with axioms for set theory. If you write your set like $\{x\in\mathbb{N}\ |\ \exists y\in\mathbb{N}: y^2=x\}$, it becomes immediately apparent that it is constructed by taking a set that you already know ($\mathbb{N}$) and sieving through it by a simple condition (your square roots are  more complicated because they involve things outside the natural numbers, i.e. $\{x\in\mathbb{R^+}\ |\ \sqrt{x}\in\mathbb{N}\}$).
Constructions like these are guaranteed to be sensible sets by the axiom scheme of separation.
The paragraph above may be a little beyond the scope of the material you're learning right now, but hopefully it convinces you that there is a point in rigorous notation.
A: This should do the job,
$$\{n\cdot n| n\in\mathbb{N}\}.$$
