Assume such an extension exists, then
Solution 1:Define $g(z)=zf(z),$ by the mean value property of holomorphic functions
$$0=g(0)=\frac{1}{2\pi}\int_0^{2\pi} g(e^{it}) dt = \frac{1}{2\pi}\int_0^{2\pi} 1 \,dt = 1$$
which is a contradiction.
Solution 2: We have $|f(z)|=1$ on $S^1.$ Since $f$ is continuous on the boundary $\partial \overline{D}=S^1$ then, by maximum modulus principle, it attains its maximum on the boundary $S^1.$ ($f$ is not constant.) Consequently, $f(D) \subseteq D.$ WLOG assume that $f(0)=0$, therefore, by Schwarz lemma $f(z)=az$ where $|a|=1.$ Moreover, we should have $az=1/z$ on $S^1$, that is, $a.1=1/1 \rightarrow a=1$ and $ai=1/i=-i \rightarrow a=-1.$ Hence, a contradiction.
If $f$ is continuous on $\overline{\mathbb D}$ then it is bounded. In that case there is a strong consequence of Jensen's formula. If $|f| \leq M$, $f(0) \neq 0$ and $S$ is the (possibly infinite) multiset of roots of $f$ on $\mathbb D$ then
$$\prod_{z \in S} |z| \geq \frac{|f(0)|}{M} > 0.$$
This implies that $$\sum_{z \in S}(1-|z|) < \infty.$$
So, loosely speaking, the roots of $f$ must quickly converge to the unit circle. The condition $f(0) \neq 0$ can be circumvented. There is a unique integer $m \geq 0$ such that $$g(z) = \frac{f(z)}{z^m}$$ is holomorphic and $g(0) \neq 0$. If $S$ is the multiset of non-zero roots of $f$ then the inequality above becomes
$$\prod_{z \in S} |z| \geq \frac{|f^{(m)}(0)|}{m! \, M}.$$
An explicit example of a function $f$ that is holomorphic on $\mathbb D$, continuous on $\overline{\mathbb D}$ and has infinitely many roots is
$$ f(z) = (1-z^2) \sin(\operatorname{atanh}(z)).$$
To understand this example, note that $\operatorname{atanh}$ maps $\mathbb D$ biholomorphically onto the strip $\{ z \mid -\frac{\pi}{4} < \operatorname{Im}(z) < \frac{\pi}{4} \}$ where $\pm 1$ maps to $\pm \infty$. Now note that $\sin$ is bounded and has infinitely many roots on this strip. The factor $1-z^2$ makes sure that it is continuous at $\pm 1$ (and has roots there as it should).
Best Answer
Let us assume that $f:\mathbb{D}\rightarrow\mathbb{C}$ is holomorphic and extends continuously to $\partial\mathbb{D}$ with $f(z)=\frac{1}{z}$ for $z\in\partial\mathbb{D}$.
By the maximum principle, we have $|f(z)|\le 1$ for all $z\in\mathbb{D}$, since $|f(z)|=|\frac{1}{z}|=1$ for $z\in\partial\mathbb{D}$.
Consider the function $g(z)=zf(z)$. $g$ is also holomorphic, satisfies $|g(z)|\le 1$ and extends continously to $\partial\mathbb{D}$ with $g(z)=1$ for $z\in\partial\mathbb{D}$.
By the mean value property, we have
$$g(0)=\frac{1}{2\pi} \int_0^{2\pi} g(e^{i\phi})d\phi=\frac{1}{2\pi}\int_0^{2\pi} d\phi=1$$
By the maximum principle we get that $g$ must be constant. Since it is $1$ on the boundary, we have $g(z)=1$ for all $z\in\overline{\mathbb{D}}$. Therefore
$$f(z)=\frac{g(z)}{z}=\frac{1}{z}$$
That is a contradiction, because $1/z$ has a pole at $0$. Hence there exists no such $f$.