Since it is separable and metric, $Y$ must have a countable base $\mathscr{B}$. Let $\mathscr{A}=\{f[B]:B\in\mathscr{B}\}$. The members of $\mathscr{A}$ need not be open in $X$, but $\mathscr{A}$ is a net (or network, according to some authors) in $X$: each open set $U$ in $X$ is the union of members of $\mathscr{A}$. Equivalently, if $x\in X$ and $U$ is an open nbhd of $x$, then there is an $A\in\mathscr{A}$ such that $x\in A\subseteq U$.
Lemma: Let $\langle X,\tau\rangle$ be a compact Hausdorff space, and let $\mathscr{A}$ be an infinite net in $X$. Then $X$ has a base of cardinality $|\mathscr{A}|$.
Given the lemma, the desired result is almost immediate: $X$ has a countable net, so $X$ is a second countable compact Hausdorff space, and it follows immediately from the Uryson metrization theorem that $X$ is metrizable.
Proof of Lemma: Let $\mathscr{P}$ be the set of pairs $\langle A_0,A_1\rangle\in\mathscr{A}\times\mathscr{A}$ such that there are disjoint open sets $V_0$ and $V_1$ in $X$ with $A_0\subseteq V_0$ and $A_1\subseteq V_1$. For each $\pi=\langle A_0,A_1\rangle\in\mathscr{P}$ choose disjoint open sets $V_0(\pi)$ and $V_1(\pi)$ such that $A_0\subseteq V_0(\pi)$ and $A_1\subseteq V_1(\pi)$. Let
$\mathscr{S}=\{V_0(\pi):\pi\in\mathscr{P}\}\cup\{V_1(\pi):\pi\in\mathscr{P}\}\;,$
and let $\mathscr{B}$ be the set of all intersections of finite subfamilies of $\mathscr{S}$; $\mathscr{B}$ is a base for a topology $\tau'$ on $X$, $|\mathscr{B}|=|\mathscr{A}|$, and it’s not hard to check that $\tau'$ is Hausdorff.
Clearly $\tau'\subseteq\tau$, so the identity map $1_X:X\to X:x\mapsto x$ is a continuous bijection from $\langle X,\tau\rangle$ to $\langle X,\tau'\rangle$. Because $\langle X,\tau\rangle$ is compact and $\langle X,\tau'\rangle$ is Hausdorff, $1_X$ is also open and therefore a homeomorphism. Thus, $\tau'=\tau$. $\dashv$
For the second part, consider the map $\Bbb R\to S:x\mapsto x$, where $\Bbb R$ is the real line with the usual metric, and $S$ is the Sorgenfrey line.