Why is compactness so important? I've read many times that 'compactness' is such an extremely important and useful concept, though it's still not very apparent why. The only theorems I've seen concerning it are the Heine-Borel theorem, and a proof continuous functions on R from closed subintervals of R are bounded. It seems like such a strange thing to define; why would the fact every open cover admits a finite refinement be so useful? Especially as stating "for every" open cover makes compactness a concept that must be very difficult thing to prove in general - what makes it worth the effort?
If it helps answering, I am about to enter my third year of my undergraduate degree, and came to wonder this upon preliminary reading of introductory topology, where I first found the definition of compactness.
 A: Well, here are some facts that give equivalent definitions:


*

*Every net on a compact set has a convergent subnet.

*Every ultrafilter on a compact set converges.

*Every filter on a compact set has a limit point.

*Every net in a compact set has a limit point.

*Every universal net in a compact set converges.
Here are some more useful things:


*

*Every continuous bijection from a compact space to a Hausdorff space is a homeomorphism.

*Every compact Hausdorff space is normal.

*The image of a compact space under a continuous function is compact.

*Every infinite subset of a compact space has a limit point.
A: I would like to give here a example showing why compactness is important. Consider the following Theorem:
Theorem: Let $f:\mathbb{R}\to \mathbb{R}$ be a continuous coercive function. Then, there exist $x_0\in \mathbb{R}$ such that $$\tag{1} f(x_0)=\inf_{x\in\mathbb{R}}f(x)$$
Proof: Let $I=\inf_{x\in\mathbb{R}}f(x) $ and choose $x_n\in \mathbb{R}$ with $f(x_n)\to I$. We claim that $x_n$ is bounded. Indeed, if $x_n$ was not bounded, then we could extract a subsequence of $x_n$ not relabeld such that $f(x_n)\to \infty$ (by coercivity) which is an absurd. Now, $x_n$ being bounded implies without loss of generality that (compactness) $x_n\to x$. Because $f$ is continuous, we conclude that $f(x_n)\to f(x)=I$.
The main argument of the proof was the fact that the closure of any bounded set in $\mathbb{R}$ is compact. Now consider the problem ($\Omega\subset\mathbb{R}^N$ bounded domain)
$$
\tag{P} \left\{ \begin{array}{ccc}
 -\Delta u =f&\mbox{ in $\Omega$} \\
  u\in H_0^1(\Omega) &\mbox{ }
       \end{array} \right.
$$
We say that $u\in H_0^1(\Omega)$ is a solution of (P) if $$\int_\Omega\nabla u\nabla v=\int_\Omega fv,\ \forall\ v\in H_0^1(\Omega)\tag{3}$$
Let $F:H_0^1(\Omega)\to \mathbb{R}$ be defined by $$F(u)=\frac{1}{2}\int_\Omega |\nabla u|^2-\int_\Omega fu$$
$(3)$ is equivalently to $\langle F'(u),v\rangle =0$ for all $v\in H_0^1(\Omega)$ and this equality is equivalently to find a local minimum of $F$ in $H_0^1(\Omega)$. One can check that $F$ is continuous and coercive, so we could try to use the same argument as above to find a minimum to $F$, but the problem here is lack of compactness, i.e. if $K\subset H_0^1(\Omega)$ is bounded we can't conclude that the closure of $K$ is compact.
Therefore to see how important compactness is, the above problem can be solved by considering a new topology in $H_0^1(\Omega)$, to wit, the weak topology. In this topology we have less open sets which implies more compact sets and in particular, bounded sets are pre-compact sets. It can be show that $F$ is weakly sequentially lower semi continuous, i.e. $F$ is lower sequentially continuous in the weak topoogy, which together with coercivity implis the existence of a minimum.
To conclude,take a look on these examples (they show how worse can be lack of compactnes): here and here.
A: If you have some object, then compactness allows you to extend results that you know are true for all finite sub-objects to the object itself.  
The main result used to prove this kind of thing is the fact that if $X$ is a compact space, and $(K_\alpha)_{\alpha\in A}$ is a family of closed sets with the finite intersection property (no finite collection has empty intersection) then $(K_\alpha)$ has non-empty intersection.  For if $(K_\alpha)$ has empty intersection then the complements of the $K_\alpha$ form an open cover of $X$, which then has to have a finite subcover $(X\setminus K_{\alpha(i)})_{i=1}^n$, and so the $(K_{\alpha(i)})_{i=1}^n$ is a finite collection of the $K_\alpha$ with empty intersection.
For example, the De Bruijn-Erdős Theorem in graph theory states that an infinite graph $G$ is $n$-colourable if all its finite subgraphs are $n$-colourable (i.e., you can colour the vertices with $n$ colours in such a way that no two vertices connected by an edge are the same colour).  You can prove this by noting that the space $X$ of all colourings of the vertices of $G$ with $n$ colours (for which vertices of the same colour may share an edge) is a compact topological space (since it is the product of discrete spaces).  Then, for each finite subgraph $F$, let $X_F$ be the set of all colourings of $G$ that give an $n$-colouring of $F$.  It can be checked that the $X_F$ are closed and have the finite intersection property, so they have non-empty intersection, and any member of their intersection must $n$-colour the whole of $G$.  
In general, if you have some property that you know is true for finite sub-objects, then you can often encode that in a collection of closed sets in a topological space $X$ that have the finite intersection property.  Then, if $X$ is compact, you can show that the closed sets have non-empty intersection, which normally tells you that the result is true for the object itself (sorry that this is all so imprecise!)
A very closely-related example is the compactness theorem in propositional logic: an infinite collection of sentences is consistent if every finite sub-collection is consistent.  This can be proved using topological compactness, or it can be proved using the completeness theorem: if the collection is inconsistent, then it must be possible to derive a contradiction using finitely many finite statements, so some finite collection of sentences must be inconsistent.  Either way you look at it, though, the compactness theorem is a statement about the topological compactness of a particular space (products of compact Stone spaces).  
A: Simply put, compactness gives you something to work with, this "something" depending on the particular context.  But for example, it gives you extremums when working with continuous functions on compact sets.  It gives you convergent subsequences when working with arbitrary sequences that aren't known to converge; the Arzela-Ascoli theorem is an important instance of this for the space of continuous functions (this point of view is the basis for various "compactness" methods in the theory of non-linear PDE).  It gives you the representation of regular Borel measures as continuous linear functionals (Riesz Representation theorem).  Etc.
A: I want to elaborate Sargera's and Tomás' theme. 
Topological considerations are great, but to me the examples are not as concrete as for when we speak of "sequential compactness" (which unfortunately in general topologies does not equate to compactness, but includes for example weak/weak* compactness).
In this situation, for practical purposes, all I want to know about topologically for a given setting is, given a sequence of points in my space, define a notion of convergence. Give me the definition of convergence to play with, and we can talk about sequential compactness. For sequential compactness of a set, we ask: "Given an arbitrary sequence in the set, does there exist a convergent subsequence?"
In general, the usefulness of this is that often we want to find a function with some property $P$, but we can only find functions with property $P_n$, which is close to $P$ as $n$ gets larger, and taking a limit as $n \to \infty$ would get property $P$. (In Tomás' example, $P_n$: "functions that achieve objective value within $1/n$ of the infimum", and $P$: "function that achieves infimum"). However, the functions satisfying property $P_n$ may not converge as we take $n$ to $\infty$, so we would not be able to take a limit of the function sequence. If the set of functions is sequentially compact (with respect to whatever notion of convergence we are working with), we can take a subsequence that converges and obtain the desired function satisfying property $P$!
(Replace function in previous part by point in set, and we can talk about other things like measures, $\mathbb{R}^N$, etc... it's just so often I am applying this to functions or measures. In probability they use the term "tightness" for measures)
Hmm.. one caveat for the above: for the notion of convergence being used, one would have to prove that the convergence preserves the property, or the property is continuous with respect to the notion of convergence. So in Tomás' example again, weak convergence is still good enough to obtain the minimizer. I think it's a great example because it motivates the study of weaker notions of convergence. Note that we need weak convergence in that example (the PDE example with $H^1$) because it is infinite dimensional, and it is not true that the feasible set of the optimization problem is compact under the usual norm-convergence.
A: Compactness is the next best thing to finiteness.
Think about it this way: 
Let $A$ be a finite set, let $f: A \to \mathbb{R}$ be a function. Then $f$ is trivially bounded. 
Now let $X$ be a compact set, set $f: X \to \mathbb{R}$ be a continuous function. Then $f$ is also bounded...
A: It's already been said that compact spaces act like finite sets. A variation on that theme is to contrast compact spaces with discrete spaces.
A compact space looks finite on large scales. A discrete space looks finite on small scales. A $T_1$ space is finite if and only if it is both compact and discrete. So we have the slogan "compactness = finiteness modulo discreteness".
A locally compact abelian group is compact if and only if its Pontryagin dual is discrete. So we have another slogan, "compactness = Fourier transform of discreteness".
A: We can think of a closed set in $X$ as being like the locus of $x\in X$ where a continuous function $f(x)$ is $0$.
Now suppose there is a continuous function $f(x,p)$ which depends on a parameter $p$. Under what conditions can we say that the locus of $x$ for which there exists $p$ so that $f(x,p)=0$? The condition is that $p$ various over a compact space.
Put differently, we know that a union of closed sets need not be closed. Under what condition is the union of a parametric family of closed sets closed? With appropriate definitions, if it is a "continuous family" where the parameter space is compact.
In more formal terms: A space $P$ is compact if and only if $X\times P\to X$ is closed for every space $X$.
This can be useful in many contexts. For example, given parametric equations $T^n+a_1(p)T^{n-1}+\dots+a_n(p)=0$, the collection of solutions is a closed set as long as $a_i$'s are continuous functions on a compact set.
A: As many have said, compactness is sort of a topological generalization of finiteness. And this is true in a deep sense, because topology deals with open sets, and this means that we often "care about how something behaves on an open set", and for compact spaces this means that there are only finitely many possible behaviors.
But why finiteness is important? Well, finiteness allows us to construct things "by hand" and constructive results are a lot deeper, and to some extent useful to us. Moreover finite objects are well-behaved ones, so while compactness is not exactly finiteness, it does preserve a lot of this behavior (because it behaves "like a finite set" for important topological properties) and this means that we can actually work with compact spaces.
The point we often miss is that given an arbitrary topological space on an infinite set $X$, the well-behaved structures which we can actually work with are the pathologies and the rare instances. This is throughout most of mathematics. It's far less likely that a function from $\Bbb R$ to $\Bbb R$ is continuous, differentiable, continuously differentiable, and so on and so forth. And yet, we work so much with these properties. Why? Because those are well-behaved properties, and we can control these constructions and prove interesting things about them. Compact spaces, being "pseudo-finite" in their nature are also well-behaved and we can prove interesting things about them. So they end up being useful for that reason.
A: One reason is that boundedness doesn't make sense in a general topological space. For example $(-1, 1) \subset \mathbb{R}$ is bounded when viewing $\mathbb{R}$ as a metric space with the usual Euclidean metric, but as topological spaces, $(-1, 1)$ and $\mathbb{R}$ really are the same, that is, homeomorphic.
So why then compactness? Well, I suppose part of the motivation is the Heine-Borel Theorem, which says a subset of $\mathbb{R}^n$ is compact if and only if it is closed and bounded; or said another way, a closed set is compact if and only if it is bounded. So, at least for closed sets, compactness and boundedness are the same. This relationship is a useful one because we now have a notion which is strongly related to boundedness which does generalise to topological spaces, unlike boundedness itself. In addition, at least for Hausdorff topological spaces, compact sets are closed. So one way to think about compact sets in topological spaces is that they are analogous to the bounded sets in metric spaces. The analogy here is not exact because the Heine-Borel Theorem only applies to $\mathbb{R}^n$, not every metric space, but hopefully this gives you some intuition.
A: Compactness is important because:
1)It behaves greatly when using topological operations
a)It's a condition that is carried on by continuous functions on any topological space, that is, if $C$ is compact and $f:C \rightarrow Y$ where $Y$ is a topological space, then $f(C)$ is compact in Y.
b)An arbitrary product of compact sets is compact in the product topology.
2) Compact sets behave almost as finite sets, which are way easier to understand and work with than uncountable pathologies which are common in topology.
Compactness is useful even when it emerges as a property of subspaces:
3) Most of topological groups we face in math every day are locally compact, e.g $\mathbb{R}$,  $\mathbb{C}$, even  $\mathbb{Q_P}$ and  $\mathbb{R_P}$ the p-adic numbers.
4) It is often easier to solve a differential equation in a compact domain than in a non-compact.
5) There are many types of convergence of functions, one of which is convergence in compact set.
6) Regular borel measure, one of the most important class of measures is defined by limits of measures in compact sets.
This list is far from over...
Anyone care to join in?
A: Compactness does for continuous functions what finiteness does for functions in general.
If a set $A$ is finite, then every function $f:A\to \mathbb R$ has a max and a min, and every function $f:A\to\mathbb R^n$ is bounded.  If $A$ is compact, then every continuous function from $A$ to $\mathbb R$ has a max and a min and every continuous function from $A$ to $\mathbb R^n$ is bounded.
If $A$ is finite, then every sequence of members of $A$ has a sub-sequence that is eventually constant, and "eventually constant" is the only sort of convergence you can talk about without talking about a topology on the set.  If $A$ is compact, then every sequence of members of $A$ has a convergent subsequence.
A: Every continuous function is Riemann integrable-uses Heine-Borel theorem. Since there are a lot of theorems in real and complex analysis that uses Heine-Borel theorem, so the idea of compactness is too important.  
