To define a real exponential function $$f(x)=a^x=e^{x \,\mathrm{lg} a}$$
It is strictly necessary that $a>0$.
But is the same true if the exponent is a natural number?
In function series and moreover in power series I see things like $$\sum_{n\geq0} f(n) x^n, \,\,\,\, x\in \mathbb{R}$$ So there is not the resctriction $x>0$.
It makes sense because natural number in the exponent do not create problems like even roots of negative numbers, so I think I'm ok with this.
Nevertheless if I rewrite $x^n$ using the definition of logaritm (for example this passage is useful while evaluating limits of such expressions), I get
$$\sum_{n\geq0} f(n) \,\, e^{n \, \mathrm{lg}x}$$
So suddenly I get a $\mathrm{lg}x$ and I need the condition $x>0$.
On the one hand this passage should be valid because it is just the definition of logaritm, but on the other hand it looks like I cannot perform it without meet a restriction on $x$ that was not present in the form $x^n$.
So what is the point here? Is the use of the definition of logaritm not allowed in these cases, or is it wrong to avoid setting the condition $x>0$ in $x^n$?
No, it is not valid in general, since $x^n = e^{n \ln x}$ is only valid for $x \gt 0$.
One could technically use $x = |x| \cdot \operatorname{sgn}(x)$ to write it as $$x^n = e^{n \ln |x|} \cdot \operatorname{sgn}(x)^n \quad \forall \;x \in \mathbb{R} \setminus \{0\}, \;n \in \mathbb{Z} $$
though that would look quite odd in practice. Most often, one would use an appropriate substitution to first remap the variable to a positive domain, instead.