first it is important to note for what sets of real numbers each statement holds
sqrt(x^2 ) = |x| is true for all x in R
(sqrt(x))^2 = x is true for all x>=0
since in real number calculations the sqrt function is undefined for negative inputs
however if we extend the definition of the function with complex numbers then for x<0:
(sqrt(x))^2
= (sqrt(-|x|))^2
= (sqrt(|x|)* i)^2
= i^2 |x|
= -|x|
= x
hence it overall follows for all x in R: (sqrt(x))^2 = x
now about your second statement:
x^(a/2) = sqrt(x^a )
this is certainly true for x,a>=0
it also holds for a<0 and x=/=0
if x<0 then issues start to appear, for example for x=-1 and a=2
(-1)^(2/2) = -1 but
sqrt((-1)^2 ) = sqrt(1) = 1
i hope that answers your question