$Log(z^2)$ analytic for all of the complex plane except origin. The question was show $\ln{x^2 + y^2}$ is harmonic in two ways. It was very easy to show by LaPlace's equation, but next I have to show it by showing it is the real part of an analytic function. 
I am using the function $Log(z^2)=\ln{|z^2|}+i Arg(z^2)$. I want to show now that $Log(z^2)$ is analytic for all of the complex plane except the origin. 
$$$$
I know that $Log(z)$ is analytic for all of the complex plane except the negative x-axis, so I have to find where $z^2=x^2-y^2+i 2xy$ satisfies $x^2 -y^2 \leq 0$ and $2xy= 0$. 
I have therefore that since we cannot have $2xy = 0$, we cannot have $x=0$ or $y=0$, then I consider the two cases to see what happens to the real part.
$$$$
When $y=0$, $x^2\leq 0$ is satisfied only for $x=0$, so clearly the function is not going to be analytic at the origin. But for $x=0$, I have $-y^2 \leq 0$ is satisfied for all $y$, which implies the function is also not analytic when $x=0$ for all $y$. But, this contradicts the question saying that the function is analytic in all of the complex plane except the origin. What step am I messing up here? 
$$$$Thanks!
 A: $\log z$ is locally analytic in the full punctured plane (so then is $\log {z^2}$ due to $z \to z^2$ preserving said punctured plane and being analytic) since you can define it on the negative real axis (minus 0) by excluding the positive real axis for example and that's the property you need for harmonicity of $\log ({x^2+y^2})$ since that is a local property (needs to be satisfied in the neighborhood of every point in the domain) but not a global property - for example having a harmonic conjugate is a global property and $\log ({x^2+y^2})$ has such only on simply connected domains excluding zero (so on the plane minus a ray say), but not on the full punctured plane
Your mistake is in considering only the principal branch of the $\log$ and that is not defined on the negative axis; but when you square, the imaginary axis is sent to the negative reals ray, hence your result that $Log(z^2)$ is not defined there which is true; but other branches will work there (except at 0 of course)
A: You know $\log z$ is analytic on $U=\mathbb C \setminus (-\infty,0].$ Thus $\text {Re}\log z =\log |z|$ is harmonic in $U.$ This implies $2\log |z| = \log|z|^2 = \log (x^2+y^2)$ is harmonic in $U.$
Now harmonicity is preserved under the map $(x,y) \to (-x,-y).$ In our case, that means $\log ((-x)^2+(-y)^2)= \log (x^2+y^2)$ is harmonic in $-U= \mathbb C \setminus [0,\infty).$ It follows that $\log (x^2+y^2)$ is harmonic on $U\cup (-U)= \mathbb C\setminus \{0\}.$
A: I don't think going to $\log z^2$ is the way to go. You know $\log z$ is analytic on $U=\mathbb C \setminus (-\infty,0].$ Thus $\text {Re}(\log z) =\log |z|$ is harmonic in $U.$ This implies $2\log |z| = \log|z|^2 = \log (x^2+y^2)$ is harmonic in $U.$
Now harmonicity is preserved under the map $(x,y) \to (-x,-y).$ In our case, that means $\log ((-x)^2+(-y)^2)= \log (x^2+y^2)$ is harmonic in $-U= \mathbb C \setminus [0,\infty).$ It follows that $\log (x^2+y^2)$ is harmonic on $U\cup (-U)= \mathbb C \setminus \{0\}.$
