The set of perfect squares from 1 to $n$ is $\\{x \mid 1\leq x \leq n,~ x=k^2 \text{ for some k}\\}$. We can substitute $k^2$ for $x$: $\\{k^2 \mid 1\leq k^2 \leq n\\}$. Taking the square root of both sides of the inequality, we have $$ \\{k \mid 1 \leq k \leq \sqrt{n}\\}, $$ But this set has at most $\sqrt{n}$ elements (less if $n$ is not a perfect square). Therefore the number of perfect squares from 1 to $n$ is less than or equal to $\sqrt{n}$.