Is $\sqrt{x^2} = (\sqrt x)^2$? Take $x=4$ for example:
$ \sqrt{(4)^2} = \sqrt{16} = \pm4 $
However:
$ (\sqrt{4})^2 = \sqrt{\pm2}$ 
Case 1: $ (-2)^2 = 4$ 
Case 2: $ (2)^2 = 4$
Solution : $+4$
How come the $ \sqrt{(4)^2} = \pm4$; but $ (\sqrt{4})^2 = 4 $ ? 
What is missing?

Disclaimer: In the following we restrict ourselves to real numbers, not taking complex numbers and the like into consideration.

By convention, the square root of a positive number $t$, written as $\sqrt t$, has been defined to be the positive solution to the equation $x^2=t$. This gives meaning to the following way of specifying the two solutions (for positive $t$):
$$
x^2=t\iff x\in\{\sqrt t,-\sqrt t\}
$$

With this your example becomes $\sqrt{4^2}=4$ and $(\sqrt 4)^2=4$, but on the other hand we have $\sqrt{(-4)^2}=4$ whereas $(\sqrt{-4})^2$ is undefined, because $\sqrt{-4}$ is undefined, since $x^2=-4$ has no solutions.

In general, $\sqrt{x^2}$ agrees with $(\sqrt x)^2$ for non-negative input $x$, whereas only the first is defined for negative values of $x$.
