I have many problems with this exercise:
Give an example of $T_{1}$ Topological Space $(X,\tau)$ and a subset $Y\subset X$ compact such that $\bar{Y}$ is not compact.
Now, honestly, I know this example:
$X= A\sqcup B$ where $A$ and $B$ are infinite sets, and $\tau_{X} = \lbrace\emptyset\rbrace\cup\lbrace \mathcal{U}\in X\mid A\setminus\mathcal{U}$ is finite$\rbrace$
But I'd like to find other examples... the problem is that I don't know much Topologies $T_{1}$ but not $T_{2}$; I know Cofinite Topology and Zariski Topology but these examples don't work, I know that the Alexandroff extension of $\mathbb{Q}$ is $T_{1}$ but not $T_{2}$, but I don't think that it's work.
Can someone help me?
Here is a broad generalization of your example which perhaps makes it appear more natural. Given a topological space, you can add any number of "copies" of any of its points, the same way that you build the "line with doubled origin" from $\mathbb{R}$ by adding another copy of $0$.
To be precise, suppose $A$ is a topological space, $B$ is a set, and $f:B\to A$ is a function. Then we can define a topological space $X=A\sqcup B$ with the following topology: a set $U\subseteq X$ is open iff $U\cap A$ is open in $A$ and for each $x\in U\cap B$, $U$ contains a deleted neighborhood of $f(x)$ in $A$. (The idea here is that each $x\in B$ represents a new "copy" of the point $f(x)\in A$; if $A=\mathbb{R}$, $B$ is a singleton, and $f$ maps the point of $B$ to $0$, then $X$ is exactly the line with doubled origin).
Now suppose additionally that $A$ is a compact $T_1$ space, $B$ is infinite, and $f(x)$ is not isolated in $A$ for each $x\in B$. Then $X$ is also a $T_1$ space, and $A$ is a compact subset of it. Moreover, since $f(x)$ is not isolated for all $x\in B$, the closure of $A$ in $X$ is all of $X$. But $X$ is not compact, since for each $x\in B$, the set $A\cup\{x\}$ is open, and these form an open cover with no finite subcover.
In other words, if we take a compact $T_1$ space and add infinitely many "copies" of non-isolated points, we get an example of a $T_1$ space with a compact subset whose closure is not compact. Your example is just the special case of this where you start with an infinite set with the cofinite topology (in that case, the function $f$ doesn't matter since all points have the same deleted neighborhoods).