Proof by contradiction.Suppose $f$ is not bounded. Then there is a sequence $(p_n)_{n\in N}$ of members of $D$ with $|f(p_{n+1})|>1+|f(p_n)|$ for each $n\in N$. Since $D$ is bounded, $(p_n)_{n\in N}$ has a convergent sub-sequence $(p_{n_i})_{i\in N}$ with $n_{i+1}>n_i$ for each $i\in N$. Let $x=\lim_{i\to \infty}p_{n_i}$. It does not matter whether or not $x$ belongs to $D$. There exists $e>0$ such that $\forall u,v\in D (|u-v|<e\implies |f(u)-f(v)|<1).$ But the set $S=\{i\in N :p_{n_i}\in (x-e/2,x+e/2)\}$ is infinite,so there exist $i,j\in S$ with $i\ne j$. But when $i,j\in S$ and $i\ne j$ we have $|p_{n_i}-p_{n_j}|<e$ and $|f(p_{n_i})-f(p_{n_j})|>1$, a contradiction.For the second question let $D=(0,1)$ and let $f(x)=1/x$.