Let $K$ be an uncountable compact set in $\mathbb{C}$ such that zero is a limit point of $\partial K$, and such that $|k|\leq 1$ for all $k\in K$. I would like to find an analytic function $f:U\to\mathbb{C}$, where $U$ is some open connected subset of $\mathbb{C}$ such that $K\subseteq U$, satisfying the following properties:
(1) $|f(k)|<1$ for infinitely many $k\in \partial K$; and
(2) $|f(k)|=1$ for infinitely many $k\in \partial K$.
I'm not a complex analyst, so I have no earthly idea how to make this rigorous. But it seems to me that we can divide this up into two cases. It could be that $K$ has infinitely many extreme points, in which case we could push those out to the unit circle without bothering the points near zero, nor pushing other points in $K$ further than the unit disk. Or, it could be that $K$ has finitely many extreme points, in which case we should be able to find a smooth part of the boundary that we could push out to the unit circle, again without disturbing the points near zero nor pushing other points beyond the unit disk.
Has anything like this been studied before? I would appreciate some tips, or an answer if one is available. Thank you.
EDIT: It might also be nice--although not necessary--to get this condition too:
(3) $|f(k)|\leq 1$ for all $k\in K$.
This is in general not possible, here is a counterexample: Let $K$ be the line segment $[0,1]$, and assume that there is an analytic function $f:U \to \mathbb{C}$ in a neighborhood of $K$ such that $|f(z)| = 1$ for infinitely many $z \in K$. Fix any such point $z_0$. Then there exists a neighborhood $K_{z_0}$ of $z_0$ in $K$ such that $f(K_{z_0})$ is an analytic curve (or in the case of a critical point the $n$-th power of an analytic curve) intersecting the unit circle at $f(z_0)$. This implies that either $f(z_0)$ is (locally) an isolated intersection point or that $f(K_{z_0})$ is a subset of the unit circle. In the latter case by the uniqueness theorem, $f(K)$ is a subset of the unit circle, and so $|f(z)|=1$ for all $z \in K$. This implies that all intersection points are isolated, and so there are only finitely many.