Summation problem: $f(x)=1+\sum_{n=1}^{\infty}\frac{x^n}{n}$

I don't know how familiar your are with power series, but this has to do with the notion of radius of convergence.

$\sum \left(\frac{x^n}{n}\right)_{n\in\mathbb{N^*}}$ is a power series with a radius of convergence $R=1$ (which can be proved by the ratio test), so indeed, it does converge for $|x|<1$, and does diverge for $|x|>1$.

As for $x=1$, the only case with $x=-1$ were we can't conclude right away, it could naively be anything, but it happens to converge.

The power series $\sum \left(x^n\right)_{n\in\mathbb{N^*}}$ is indeed the derivative of the previous one : we know it has the same radius of convergence, so for $x=1$, here again it could be anything ; and it happens to diverge.

The convergence circle is the only place were the convergence of a power series and its derivatives aren't always equivalent : it could be anything, and you can't deduce the convergence of the derivative from the convergence of the power series there.

As to show that the power series and $f(x)=1-\ln(1-x)$ are equal also for $x=-1$ (that is to say, to prove that $f(-1)$ is the sum of the series) :

$\cdot$ The power series and f both exist for $x$ in $[-1,1)$ (for the power series, you can prove it with the ratio test)

$\cdot$ They are both continuous on $[-1,1)$ : it is obvious for $f$, and for the power series, we know that the sum of the power series is continious strictly inside the convergence disk $(-1,1)$. We extend the continuity to -1 by the uniform convergence on $[-1,0]$.

$\cdot$ Are equal to one another on $(-1,1)$ which is dense in $[-1,1]$.

We can conclude that the power series and f are equal also at $x=1$, so $f(-1)$ is indeed the sum of the series.

If you are not familiar with this density theorem :

Since the power series is continuous on -1, by definition, $\lim\limits_{x\rightarrow\ -1}\sum\limits_{n=1}^{\infty}\frac{x^n}{n}=\sum\limits_{n=1}^{\infty}\frac{(-1)^n}{n}$, the limits being taken by approaching from the right ($x>-1$).

But, since the power series and f are equal for $x>-1$, we can put $f$ instead of the power series inside the limit :

$$\lim\limits_{x\rightarrow\ -1}f(x)=\sum\limits_{n=1}^{\infty}\frac{(-1)^n}{n}$$

Or $f$ is continuous on -1, so $\lim\limits_{x\rightarrow\ -1}f(x)=f(-1)$

Hence $\sum\limits_{n=1}^{\infty}\frac{(-1)^n}{n}=f(-1)$.