Let $a\neq 1$ be a positive real number. Find all real solutions to the equation $a^x=x^x+\log_a(\log_a(x)).$ 

[i]Mihai Opincariu[/i]
1. **Assume \( x > 0 \)**: This is necessary because \( x^x \) and \( \log_a(x) \) are only defined for \( x > 0 \).

2. **Consider the case \( x = a \)**:
   \[
   a^a = a^a + \log_a(\log_a(a))
   \]
   Since \( \log_a(a) = 1 \), we have:
   \[
   \log_a(\log_a(a)) = \log_a(1) = 0
   \]
   Therefore:
   \[
   a^a = a^a + 0
   \]
   This simplifies to:
   \[
   a^a = a^a
   \]
   which is true. Hence, \( x = a \) is a solution.

3. **Consider \( x > a \)**:
   - Since \( x > a \), we have \( x^x > a^x \).
   - Also, \( \log_a(x) > \log_a(a) = 1 \), so \( \log_a(\log_a(x)) > \log_a(1) = 0 \).
   - Therefore:
     \[
     x^x + \log_a(\log_a(x)) > a^x + 0 = a^x
     \]
   - This implies:
     \[
     x^x + \log_a(\log_a(x)) > a^x
     \]
   - Hence, for \( x > a \), the right-hand side (RHS) is greater than the left-hand side (LHS).

4. **Consider \( x < a \)**:
   - Since \( x < a \), we have \( x^x < a^x \).
   - Also, \( \log_a(x) < \log_a(a) = 1 \), so \( \log_a(\log_a(x)) < \log_a(1) = 0 \).
   - Therefore:
     \[
     x^x + \log_a(\log_a(x)) < a^x + 0 = a^x
     \]
   - This implies:
     \[
     x^x + \log_a(\log_a(x)) < a^x
     \]
   - Hence, for \( x < a \), the right-hand side (RHS) is less than the left-hand side (LHS).

5. **Conclusion**:
   - From the above analysis, the only possible solution is \( x = a \).

The final answer is \( \boxed{x = a} \)