We know that discrete metric on every set (with at least 2 elements) is disconnected.but:
1) Is there exist a metric $d$ on every infinite set such that $(X,d)$ be connected space? For example $\mathbb N $ with $d(x,y) = | \frac{1}{x} - \frac {1}{y}| $ is connected space.
2) also we know there is at least one metric on infinite set that is not compact ( for example discrete metric) but is there exist a metric $d$ on any infinite set that be compact?
Any countable metric space with at least two points is disconnected, so on a countable set as $\Bbb N$ we cannot find a metric that induces a connected topology. Likewise on a set of size $\kappa < \mathfrak{c} = |\Bbb R|$.
Compactness is always possible for general spaces: if $X$ has infinite size of some cardinal $\kappa$ the order topology on $\kappa+1$ is compact and this topology can be transported to the set via a bijection. But if $X$ has to be metric, a compact metric space has size at most $\mathfrak{c}$, and so for most sets it will be impossible. Any uncountable compact metric space has size continuum (contains a Cantor set) by a standard tree argument.
So in short: to be connected metric one has to have size at least continuum and to be compact metric you have to be at most size continuum. To be both means to be size continuum like $[0,1]^n$, $\mathbb{S}^n$ etc. etc.