Solve limit using definite integration I have to solve this limit using definite integral

$${\lim_{n\to \infty} \frac{1}{n} \cdot \sum_{i=1}^n \frac{1}{1+(\frac{i}{n})^i}}$$

Well, my development was:
I tried to give the Riemann integral definition form, using a regular partition such that:
$$\int_a^bf(x)dx=\lim_{n\to\infty}\frac{b-a}{n}\cdot\sum_{i=1}f\left(a+i\frac{b-a}{n}\right)$$
So, i set $b=1, a=0$ for simplicity, then we have $f(\frac{i}{n})$ must be equal to ${\frac{1}{1+(\frac{i}{n})^i}}$.
Let ${x=\frac{i}{n}}$, then $${f(x)=\frac{1}{1+x^{nx}}}$$
The problem is that $n$ is a dummy variable that does not make sense outside the limit, that is, it does not make sense for the function $f$
So, I need to do some kind of algebraic transformation or variable change for $n$, in such a way that the function $f$ remains only in terms of $x$ and thus I can use it in the definite integral. However, I have not been able to find such a magical algebraic transformation or variable change for $n$.
 A: Denote the expression under the limit by $a_n$. Clearly $a_n<1$, so that $\limsup\limits_{n\to\infty}a_n\leqslant 1$.
Further, for a fixed $n$, and positive real values of $x$, the map $x\mapsto(x/n)^x$ has a global minimum at $x=n/e$. Thus, for $1\leqslant i\leqslant m$ we have $(i/n)^i\leqslant\max\{1/n,(m/n)^m\}$.
This gives an idea for a lower bound. Let $0<\varepsilon<1$. Then $$1\leqslant i\leqslant(1-\varepsilon)n\implies(i/n)^i\leqslant\max\{1/n,(1-\varepsilon)^{n(1-\varepsilon)}\}\color{gray}{\underset{n\to\infty}{\longrightarrow}0},$$ hence there exists $N_\varepsilon$ such that for $n>N_\varepsilon$ and $1\leqslant i\leqslant(1-\varepsilon)n$ we have $(i/n)^i<\varepsilon$, and $$a_n>\frac1n\times\lfloor(1-\varepsilon)n\rfloor\times\frac1{1+\varepsilon}\implies\liminf_{n\to\infty}a_n\geqslant\frac{1-\varepsilon}{1+\varepsilon}.$$
Since $\varepsilon$ is arbitrary, we have $\liminf\limits_{n\to\infty}a_n\geqslant 1$, giving finally $\lim\limits_{n\to\infty}a_n=1$.

A variant with Riemann sums (far-fetched): take a positive integer $m$, then for $n\geqslant m$ $$a_n:=\frac1n\sum_{i=1}^n\frac{1}{1+(i/n)^i}\geqslant\frac1n\sum_{i=1}^nf_m(i/n),\quad f_m(x):=\frac{1}{1+x^{mx}},$$ so that $\liminf\limits_{n\to\infty}a_n\geqslant\int_0^1 f_m(x)\,dx$ and, since $m$ is arbitrary, we may take $m\to\infty$: $$\liminf_{n\to\infty}a_n\geqslant\lim_{m\to\infty}\int_0^1 f_m(x)\,dx=1.$$
A: As it is really shown in OP, for $\;x=\dfrac in\in(0,1]\;$
$$f(x) =\lim\limits_{n\to\infty}\;\dfrac 1{1+x^{nx}}=\genfrac{\{}.0{}{1,\text{ if }x\in(0,1)}{\;^1/_2,\text{ if } \;x=1,\;}$$
i.e. the function $\;f(x)\;$ has a removable discontinuity at the point $\;x=1\;$ and is equaled to $1$ at the other points of the domain.
Therefore,
$$\color{brown}{\mathbf{\lim\limits_{n\to\infty}\,\dfrac1n\,\dfrac1{1+\left(\large\frac in\right)^i} = \int\limits_0^1\, 1\,\text dx =1.}}$$
A: By proceeding through your method, we have obtained f(x) as $\frac{1}{1+x^{nx}}$, as mentioned in the question.
So, when n approaches infinity,
$f(x)=0 $$ $ if  $ x $ $ ϵ$ $ (0,1),$
and at $x=1$,
$lim $ $n->∞, f(x)=2 $
So, $ f(x)=1 $ at all but finite points and hence,
Given Sum= $$\int_{0}^{1}1dx$$
$$=1$$
(We can further write the integral as $\int_{0}^{1}1dx$ + $\int_{1}^{1}2dx $ = $1+0$ but that is understood.)
