Let $D = \{z \mid |z| < 1\}$. From all the analytic functions over $D$, which satisfy $$f(0)=1, \quad f\left(\frac{1}{2}\right)=0$$find the function whose $\sup_{z \in D}|f(z)|$ is the least possible. Prove that this function is unique, i.e. no other function gets such a low supremum.
All I can say is that ignoring all $f$'s whose supremum is infinite, if $M$ is the supremum of a certain function $f$, take $\frac{f}{M}$, and then by the (extended) schwarz lemma,
$$\left|\frac{f(z)}{M}\right| \leq \left|\frac{z-\frac{1}{2}}{1-\frac{1}{2}z}\right| $$
How to continue?
You are on the right track with $$ \tag{*} \left|\frac{f(z)}{M}\right| \leq \left|\frac{z-\frac{1}{2}}{1-\frac{1}{2}z}\right| \, . $$ Setting $z = 0$, $f(0) = 1$ gives $$ \frac 1M \le \frac 12 $$ so that $M \ge 2$.
If $M = 2$ then equality holds in $(*)$ for $z = 0$, this implies $$ \frac{f(z)}2 = \lambda \frac{z-\frac{1}{2}}{1-\frac{1}{2}z} $$ for some constant $\lambda \in \Bbb C$ with $|\lambda | = 1$. Setting $z = 0$ again shows that $$ f(z) = -2 \frac{z-\frac{1}{2}}{1-\frac{1}{2}z} $$ is the unique function for which the minimal supremum $M = 2$ is attained.