Sign of square root of a real number May we write $\sqrt{x^2}=\pm x$.      
Is  $\sqrt{x^2}=\sqrt{(\pm x)^2}=\pm{x}$ true ?
 But we write $\sqrt{x^2}=|x|=x$
What is the actual logic? 

The square root is like a function. The function $f(x)=\sqrt{x^2}$ exists, but the function $f(x)=\pm \sqrt{x^2}$ does not. By convention, we define $\sqrt{x^2}=|x|$, but logically $\sqrt{x^2}=-x$ as well.
Think of it like a traffic light. We define the red light to mean "stop", and the green light to mean "go". But logically, it could be the other way around. But if you think the green light means "stop", people are going to take you for a fool. Same with the whole $\sqrt{x^2}=|x|$ thing.
If you want an explanation from a mathematical point of view, continue reading. The function $g(x)=\sqrt{x}$ is the inverse of the function $f(x)=x^2$. But, we must restrict the domain to $x \ge 0$ in order for $f(x)$ to have an inverse. If the domain was $x \in \mathbb{R}$, $f(x)$ would not pass the horizontal line test.
