For any positive integer $n$, $\sqrt{n^2}=n$. This looks pretty obvious, but if the nature of an irrational number is considered it doesn't look that obvious.

I mean, $\sqrt n$ where $n$ is not a perfect square will be irrational and have an infinite decimal expansion. But consider
$$17=17.00000000\dots$$
No number from 0 to 9 will give 0 as the result. That looks like it makes impossible an irrational number squaring to a positive integer, as the only way to get a 0 in all decimal places would be to have all digits on the supposed irrational number 0.

I'm not a maths person, so I may have committed lots of errors, but it doesn't look like there's any big one, understanding it in the level that a non-maths person should have. What's the failure in my reasoning?