First, to answer the question in your comment, it seems that you claim:
If $A$ is a compact metric space, for all functions $f:A\to\Bbb R$, $f(A)$ compact implies $f$ continuous.
This claim is false. For example, consider $A=[-1,1]$ as a metric subspace of $\Bbb R$ and define $f:A\to\Bbb R$ by $$f(x)=\begin{cases} 1&\text{if } x\gt 0\\ -1&\text{otherwise}\end{cases}.$$ Thus $f(A)$ is the compact set $\{-1,1\}$ but $f$ is not continuous.
Second, I'll give a proof using sequential compactness, something equivalent to continuity, namely sequential continuity, something else.
Proof.
Assume then that $(A,d)$ is a compact metric space, and $f:A\to\Bbb R$ is a function such that $$G=\{(x,f(x)):x\in A\}$$ is compact in $(A\times\Bbb R,D)$ where $D$ is the usual product metric (one of the usual metrics) given by $$D((u,x),(v,y))=d(u,v)+|y-x|.$$
Since we are dealing with metric spaces, it is enough to show that $f$ is sequentially continuous.
Then, consider a sequence $(x_n)$ in $A$ with $$\lim_{n\to\infty} x_n=x\in A.$$
We must show that $$\lim_{n\to\infty} f(x_n)=f(x).$$
As says the "abstract thing" stated here, it is enough to show that every subsequence $(f(x_{n_k}))_{k\in\Bbb N}$ has a subsequence $(f(x_{n_{k_j}}))_{j\in\Bbb N}$ converging to $f(x)$.
So, consider $(f(x_{n_k}))_{k\in\Bbb N}$ a subsequence of $(f(x_n))_{n\in\Bbb N}$. We will prove that this subsequence has a subsequence converging to $f(x)$.
Since $G$ is a compact metric space, $G$ is sequentially compact, thus, the sequence $((x_{n_k},f(x_{n_k})))_{k\in\Bbb N}$ in $G$ must have a convergent subsequence, say $((x_{n_{k_j}},f(x_{n_{k_j}})))$ with $$\lim_{j\to\infty} (x_{n_{k_j}},f(x_{n_{k_j}}))=(y,f(y))\in G.$$
Notice that for each $j\in\Bbb N$ we have $$D((x_{n_{k_j}},f(x_{n_{k_j}})),(y,f(y)))\geq d(x_{n_{k_j}},y)\geq 0,$$ so $$\lim_{j\to\infty} d(x_{n_{k_j}},y)=0$$ i.e. $$\lim_{j\to\infty} x_{n_{k_j}}=y.\tag{1}$$ By similar arguments it follows that $$\lim_{j\to\infty} f\left(x_{n_{k_j}}\right)=f(y).\tag{2}$$ Since convergent sequences can have at most one limit, $(1)$ says $$x=y,$$ therefore by $(2)$ $$\lim_{j\to\infty} f\left(x_{n_{k_j}}\right)=f(x)$$ as we wanted.