It is well-known that the modulus function $|z|$ is not holomorphic.
My question is; can we make $f(z) = \sqrt{z^2}$ [which we can also write as $\sqrt{ x^2 - y^2 + 2 i x y } = f(x+iy)$] holomorphic on some subset of $\mathbb{C}$?
In some way $f(z)$ "looks like" the modulus function along the real line. Does it possess the same issues as $|z|$ at $z=0$? What about elsewhere?
The reason I am asking: I would like to perform a contour integration of some function $g( \sqrt{z^2} )$, and safely use the residue theorem (which would require $\sqrt{z^2}$ to be holomorphic). Part of my contour runs along the real line (and the rest of the contour is elsewhere in the complex plane) - the contour never hits $0$, which I am guessing is the only place where $\sqrt{z^2}$ might not be holomorphic.
If a function is positive we can talk about "the" square root, that being the positive square root. But for a complex-valued function there really is no similar notion of "the" square root, we just talk about "a" square root.
The function $z^2$ certainly has a square root that's holomorphic in the entire plane, namely $z$. (In particular, $\sqrt{z^2}$ really has nothing to do with $|z|$; I don't know why you say it "looks like" that. If $x$ is real then $|x|$ is the positive square root of $x^2$, but if $z$ is complex then $|z|$ is not even a square root of $z^2$.)