I'm in the process of studying for an exam and I came across the following question:
Prove that if $K$ is a field and $K (x)$ is the field of rational functions with coefficients from $K$, if $f\in K(x)$, then $f^2 \neq x^2-1$.
In trying to solve this I think I came up with a contradiction.
The counterexample I came up with is the following: let $K = \Bbb Z_2$ then if $f= x+1$, $f^2=(x+1)^2$, so in $\Bbb Z_2[x], (x+1)^2= x^2 +2x+1= x^2+1= x^2-1$.
Any help with why my counterexample does not work or how to prove this would be much appreciated.
Edit: fixed a typo above, $f$ should be from the field of polynomials.
Set $f=\frac{Q}{P}$ where $P,Q\in\mathbb{K}[x]$ and $\gcd(Q,P)=1$. Assuming that $f^2=(x-1)(x+1)$ we get : $$Q^2=(x-1)(x+1)P^2 \qquad (*).$$ Let us work in $\mathbb{K}[x]$. You see that the prime $(x-1)$ divides $Q^2$. So $x-1$ divides $Q$ but not $P$ $(\gcd(Q,P)=1)$. Writing $Q=(x-1)Q_1$, and using $(*)$ we have : $$(x-1)Q_1^2=(x+1)P^2.$$ This leads to a condradiction if $\mathrm{Char}(\mathbb{K}) \neq 2$, since $x-1$ divides neither $P^2$ neither $x+1$. Therefore $f^2\neq (x-1)(x+1)$.
Generally, if $p$ is a prime and $b$ is a square then $\max\{k \mid p^k \text{ divides } b\}$ is even.