Does there exist a (noetherian) commutative ring $R$ and an element $a \in R$ such that $a$ is a square in every localization of $R$ but $a$ itself is not a square?

OK, I've got it. There is no such local criterion for squareness. Let $k$ be a field of characteristic not $2$. Take the ring of triples $(f,g,h) \in k[t]^3$, subject to the conditions that $f(1)=g(1)$, $g(1)=h(1)$ and $h(1)=f(1)$. Consider the element $(t^2,t^2,t^2)$. If this were a square, its square root would have to be $(\pm t, \pm t, \pm t)$. But two of those $\pm$'s would be the same sign, and $t$ evaluated at $1$ and at $1$ are not equal. Now, to check that $(t^2, t^2, t^2)$ is everywhere locally a square. Geometrically, we are talking about three lines glued into a triangle. Any prime ideal has a neighborhood which is contained in the union of two neighboring lines, say the first two. On the first two lines, $(t, t, 1)$ is a square root of $(t^2, t^2, t^2)$. For the suspicious, an algebraic proof. Set $u_1=(0, (1+t)/2, (1t)/2)$ and let $u_2$ and $u_3$ be the cyclic permutations thereof. We have $u_1+u_2+u_3=1$ so, in any local ring, one of the $u_i$ must be a unit. WLOG, suppose that $u_1$ is a unit. Notice that $u_1 (1, t, t)^2 = u_1 (t^2, t^2, t^2)$. So, in a local ring where $u_1$ is a unit, $(1,t,t)$ is a square root of $(t^2, t^2, t^2)$. 


I would try something like this: $R=\mathbb C[x,y,u,v]/(f,g)$ with $f=x(yu^2)$ and $g=(1+x)(yv^2)$ When you localize at any prime ideal, you have to invert either $x$ or $1+x$. Either way, $y$ becomes a square. The only way to make $y$ a square in $R$ is to find $a,b,h$ such that $af+bg=yh^2$. This looks unlikely, but I am too lazy to do the work. EDIT: (this does not work) here is probably an easier example using the same idea $R=\mathbb Z[x]/(f,g)$ with $f=x(x4)$ and $g=(1+x)(x1)$. Then by the same argument $x$ is a square in all localizations. In $R$, the best you can get is $4x=1$.(Oops: $x=4x^2$!) 


Asher Auel pointed out to me another example in a paper of ColliotThelene, Parimala, and Suresh: http://arxiv.org/pdf/0812.3099.pdf It is the claim in the appendix. I don't think it's so far in spirit from David Speyer's example, but it is may be more convenient for certain geometric settings. 

