Why do irrationality proofs of $\sqrt x$ not apply when $x$ is a perfect square? When trying to prove that a particular root (say $\sqrt{2}$ or $\sqrt{10}$) cannot be rational, I always see a particular indirect proof that goes something like this:
Suppose $\sqrt{x}$ were rational; then, there would be two integers $a$ and $b$ such that $a/b$ was $\sqrt{x}$. We can also assume that $a$ and $b$ have no common factors, because we can simplify $a/b$ as much as we want before we begin.
Then, $(a/b)^2 = x$, or $a^2/b^2=x$, or $a^2 = x * b^2$. But, if $a * a$ is a multiple of $x$ then $a$ must also be a multiple of $x$, so we can rewrite $a$ as $a = cx$ and substitute:
$(c * x)^2 = x * b^2$, or $x^2 * c^2 = x * b^2$. Divide by $x$ and we get that $b^2 = x * c^2$.
But we've now shown that both $a$ and $b$ have a factor of x, contradicting our original assumption; this means that $\sqrt{x}$ cannot be rational.
I see why this proof works, what I don't see is why you can't plug in a number with an actual rational root, like 16, and not form the same proof that $\sqrt{16}$ cannot be rational.
 A: The statement $x|a^2\Rightarrow x|a$ is not generally true (Counter-example : $8|4^2$ but we have not $8|4$). 
The proof works for $x$ prime, because, then, this statement is true by Euclid's lemma.
A: The proof will work for any integer $\rm\,x\,$ (or rational) that is not a perfect square, since it will have a prime factor occurring to an odd power, which is precisely what's needed for the proof to succeed. From $\rm\:a^2 = x b^2\:$ we deduce, by unique prime factorization, that the power of every prime $\rm\:p\:$ dividing $\rm\:x\:$ must be even, being the difference of two even integers (the power of $\rm\:p\:$ in $\rm\:a^2\:$ minus the power in $\rm\:b^2$).
Generally it is not true that $\rm\:x\:|\:a^2\:\Rightarrow\:x\:|\:a\ $ (e.g. let $\rm\:x = a^2 > 1)$. In fact this property is true iff $\rm\:x\:$ is squarefree, which is why the proof works for $\rm\:x\:$ prime (or a product of distinct primes) which, having at least one prime to the power one, certainly does have a prime occurring to an odd power. The general case reduces to this case by pulling the square part of $\rm\:x\:$ out of $\rm\:\sqrt{x},\:$ i.e. if $\rm\:x = n^2 y,\:$ with $\rm\:y\:$ squarefree then we have $\rm\:\sqrt{x} = \sqrt{n^2 y} = n\sqrt{y}\in \mathbb Q\iff\sqrt{y}\in\mathbb Q.$ Therefore your method of proof will work if you first reduce this way to the case where $\rm\:x\:$ is squarefree.
A: Another way to think about this is to reformulate your proof to go through the following statement:
If $\gcd(a,b)=1$, then $\gcd(a^2, b^2)=1$.
This follows immediately from unique factorization (or with a little more work from Euclidean-algorithm-type arguments). It also directly implies that any rational square root of an integer is itself an integer. Say $(a/b)^2=n$ with $a/b$ in lowest terms, then $\gcd(a,b)=1$. Thus $\gcd(a^2,b^2)=1$, so $a^2/b^2$ is a fraction in lowest terms which is also equal to an integer, and hence $b= \pm 1$.
I like this way of thinking about it because it does apply to rational roots of integers; it just gives a different conclusion (that they're integers, rather than that they're irrational).
A: Take your example for $\sqrt{16}$ and note that $a=4$ then $a^2 = 16$ does not imply $a$ is a multiple of 16.  
