Help to find the domain to this function $$
\sqrt{\log_\frac{1}{2}\left(\arctan\left(\frac{x-\pi}{x-4}\right)\right)}
$$
Please, could someone show me the steps to find the domain of this function?
It's the sixth time that I try to solve it, and I'm going to burn everything...

I assume that you are talking about the so-called "natural domain" of a real valued function of real variable (a common concept in Calculus, at least in the U.S.): given a formula, such as the above, and no words about its domain, we assume the domain is to be taken to be a subset of the real numbers, and that this subset should be "as large as possible". That is, we want the know all real numbers for which the expression makes sense and yields a real number.
So, let's analyze the expression step by step, just as you would if you were trying to evaluate it. 


*

*First, given an $x$, you would compute both $x-\pi$ and $x-4$. No problems there, that can be done with any real number $x$.

*Then you would compute $\frac{x-\pi}{x-4}$. In order to be able to do this, you need $x-4\neq 0$. So we are going to have to exclude $x=4$. That is, the domain so far is "all $x\neq 4$".

*Then we would compute $\arctan\left(\frac{x-\pi}{x-4}\right)$. Since the domain of the arctangent is "all real numbers", this can be done with any $x$ for which the fraction makes sense. We don't need to exclude any new values of $x$.

*Then we would try to compute the logarithm (base $\frac{1}{2}$) of this number. In order to be able to compute the logarithm, we need the argument to be positive. So we are going to need
$$\arctan\left(\frac{x-\pi}{x-4}\right)\gt 0.$$
When is the arctangent positive? When the argument is positive. So we need
$$\frac{x-\pi}{x-4}\gt 0.$$
When is a fraction positive? When both numerator and denominator are positive, or when they are both negative. 
So we need either $x-\pi\gt 0$ and $x-4\gt 0$ (this happens when $x\gt 4$); or $x-\pi\lt 0$ and $x-4\lt 0$ (this happens when $x\lt \pi$). So we now need to restrict our $x$s to $(-\infty,\pi)\cup(4,\infty)$. (Note that this also maintains the exclusion of $4$).

*Finally, we need to take the square root of the answer. That means that the logarithm must be nonnegative. When is $\log_{\frac{1}{2}}(a)\geq 0$? When $0\lt a \leq 1$ (taking exponentials with base $\frac{1}{2}$ flips the inequality, because $(\frac{1}{2})^x$ is decreasing). So we actually need
$$0\lt \arctan\left(\frac{x-\pi}{x-4}\right)\leq 1.$$
When is $0\lt \arctan(a)\leq 1$? When $0\lt a \lt \frac{\pi}{4}$ (thanks to Jonas Meyer for the heads up!). When $\tan(0)\lt a \leq \tan(1)$. So we need
$$0 \lt \frac{x-\pi}{x-4}\leq \tan(1).$$
Since $\tan(1)\gt 0$ This happens if either
$$0\lt (x-\pi) \lt \tan(1)(x-4)$$
or
$$\tan(1)(x-4)\lt (x-\pi)\lt 0.$$
So check the inequalities; then remember that $x$ must be greater than $4$ for both $x-\pi$ and $x-4$ to be positive; or less than $\pi$ for both to be negative. 
