In addition to Jose's point that if $y \in Y$, the set $f^{-1}(y)$ may contain more than one point, I wanted to give a bit more directed feedback on your proof. The main issues are
(i) Your proof "crashes" since you do not define your terms (similar to a computer program that crashes when it sees an undefined variable).
(ii) You do not have a correct proof structure: The reader does not know what you are trying to do.
Specifically, your proof starts:
As f is surjective, there are $x_1, x_2∈ X$ s.t $f(x_1)=y_1, f(x_2)=y_2$.
This sentence does not make sense since $y_1, y_2$ have never been defined. I assume you meant to write "As $f$ is surjective, for every $y \in Y$ there is an $x \in X$ such that $f(x)=y$." Why did you introduce two points $y_1$ and $y_2$?
And f is continuous if for every open $v⊆Y, f^{-1}(v)$ is open in X.
If X is compact, then every open covering $U=(u_i)_{i∈I}$ has a finite subcovering.
These are good statements of relevant definitions. It would help to add the detail "If $X$ is compact, then every open covering $U=(u_i)_{i \in I}$ [of $X$] has a finite subcovering." One would naturally assume this detail when reading. However, since you later have trouble defining which sets you are providing open covers for, adding this detail may help to organize your own thoughts.
Therefore, $f^{-1}(y_1)=x_1$ which is also an open covering.
This sentence takes the reader by surprise. You stated some definitions, and now you are suddenly concluding something? There are several issues here:
You never defined $y_1$ or $x_1$ and so we don't know what your sentence means.
As Jose points out, that sentence seems to assume $f^{-1}(y_1)$ is a single point, which is not necessarily true.
The word "also" in that sentence is unusual, since it suggests there is some other open cover that you previously defined, which is not the case. Just mentioning open covers in previous definitions does not identify any particular open cover that you want to work with.
The conclusion "is also an open covering" is unusual, since I do not know what you are trying to cover, I do not know how a single point could cover something, and I do not know how you are concluding that single point covers something.
Thus $Y$ is compact.
This takes the reader by surprise because it has no connection to anything you previously wrote. To prove $Y$ is compact, one would need to show it satisfies the definition of compact, so, one would need to introduce/declare/instantiate/identify an open cover of $Y$ and show it has a finite subcover. Your proof has not yet identified an open cover of $Y$. Also, your previous sentence talks about $x_1$ covering something, but since $x_1$ is presumbably in $X$, this does not help to cover $Y$.
On general proof structure:
In general, since you are trying to prove that $Y$ is compact using the definition of compact, namely, "every open cover of $Y$ has a finite subcover," your proof must have the following structure:
i) Start your proof by saying "Let $(w_i)_{i \in I}$ be an open cover of $Y$." [This introduces/declares/instantiates/identifies an open cover of $Y$ that you will work with.]
ii) Then, show that we can use a finite number of the sets in $(w_i)_{i \in I}$ to make a finite subcover of $Y$.
Notice that Jose's proof indeed has this structure. This is also true of any math problem that requires you show something satisfies a definition, see below example:
Definition: An infinite set is shiny if it satisfies property xyz"
Claim: Every infinite set with properties abc is shiny.
Proof (first two sentences): Let $X$ be an infinite set with properties abc. We want to show $X$ satisfies properties xyz.
[Notice that we can write the first two sentences of the proof even without knowing what the properties abc and xyz are. You should also write the start of your own proofs this way. It helps you organize your thoughts and helps readers know what you are trying to do.]