Edit: I made a mistake in the original answer, assuming that n is a power of 2 and reducing the recurrence to 1, 2, 4, ... n, which is wrong. I apologize for the misleading. Here is the updated answer.
From,
T(n) = T(sqrt(n)) + 5,
we can also write it as:
T(n) = T(n^(1/2)) + 5,
then by recurrence:
T(n^(1/2)) = T(n^(1/4)) + 5,
T(n^(1/4)) = T(n^(1/8)) + 5,
...
T(n^(2^-m)) = T(n^(2^-(m+1)) + 5,
this doesn't show a constant where we can stop. Therefore we need to substitute n.
Try:
n = 2^(2^m),
where we have
m = log log n
starting from m = 0, which is n = 2,
then we have:
T(n) = T(2) + 5 + 5 + ... + 5,
how many 5s are there?
We count like this:
2^(2^0), 2^(2^1), 2^(2^2), ... 2^(2^m)
So there are m 5s, where m = log log n. So
T(n) = T(2) + 5 log log n,
which is,
T(n) = O(log log n).