In what a sense we we can understand a geometric space well by understanding the functions on this space? The following is from Vakil’s notes page 99.

we can understand a geometric space (such as a manifold) well by
  understanding the functions on this space. More precisely, we will
  understand it through the sheaf of functions on the space. If we are
  interested in differentiable manifolds, we will consider
  differentiable functions; if we are interested in smooth manifolds, we
  will consider smooth functions; and so on.

I know some basic notions of diffrential manifolds and know nothing about scheme, and I couldn’t come up with an good example illustrating the above slogan, which says we could understand a space by understanding the functions on the space.
Actually this seems too general for me. What do we mean by understanding a space? What kind of properties of the space do we want to study? It seems necessary to figure out these questions in order to have a good understanding about how the slogan works as well as why understanding the space in that way is a natural consideration.
Could you give some examples to illustrate this? Thanks in advance.
 A: You should take Vakil's statement with a grain of salt: He is preparing you for standard (post-Grothendieck) definitions of algebraic varieties and schemes. These definitions are the  result of a long and winding road of development of algebraic geometry since 19th century. They proved to be optimal (as far as we know) for the purposes of algebraic geometry. There are similar viewpoints on topological spaces, metric spaces and differentiable manifolds, but they are relatively uncommon and unpopular among topologists and geometers. A good example of such a viewpoint comes from a theorem that a differentiable  manifold is uniquely determined by the ring of differentiable functions on this manifold (regarded as an abstract ring: two manifolds are diffeomorphic iff the corresponding rings are isomorphic). However, most differential geometers and topologists will never approach studying differentiable manifolds this way (there are exceptions to this rule, see below). As an example you are surely familiar with, most textbooks discuss a classification of surfaces using cutting-and-pasting of "fundamental polygons," instead of teaching you about the algebra of functions on a surface.  
Some exceptions:


*

*Defining tangent vectors to differentiable manifolds is most frequently done using the language of derivations of germs of functions. From this viewpoint, a tangent vector is identified with the corresponding "directional derivative." This viewpoint (unheard of before the middle of the 20th century) is definitely influenced by the algebro-geometric way of thinking. 

*In Riemannian geometry, one frequently studies geometric properties of manifolds by analyzing harmonic (and subharmonic) functions on manifolds, as well as eigenfunctions/eigenvalues of the Laplacian. Nevertheless, here one works analytically rather than algebraically as an algebraic geometer would do. 

*In differential topology, one frequently analyses a manifold by choosing a Morse function on such a manifold (equivalent to a "handle decomposition"- think in terms of a fundamental polygon in the surface case) and making suitable modification of a Morse function (equivalent to "handle slides"- think about cutting and pasting fundamental polygons in the surface case). 

*Many topological invariants of differentiable manifolds are defined by looking at spaces of differential forms, sections of bundles etc., satisfying certain differential equations, on the manifold. Such objects can be regarded as generalizations functions on a manifold. Examples include harmonic forms, self-dual connections, etc. 
A: Perhaps you have heard of the term 'non-commutative geometry', this comes from this question. To any locally compact Hausdorff space (manifolds are an example) one can associate the collection of continuous complex valued functions that vanish at infinity. This space of function can be given the structure of a commutative $C^*$-algebra in a natural way. Now it is a theorem that to any commutative $C^*$-algebra $A$ one can associate a space $X$ such that $A$ corresponds to the continuous complex functions on $X$. Non-commutative geometry means the study of non-commutative $C^*$-algebras.
So in this instance, if you know the functions of a geometric space, you can recover the space from it. So any information about the space can (in theory) also be gotten from the space of functions on it.
A: Well, cohomology is the study of a particular subset of the set of functions on a space, so anything you can get from cohomology is a thing you get from studying the space.  This includes defining the cup product, which turns the cohomology module into a graded ring (the cohomology ring).
But perhaps (fairly) this seems very abstract compared to your question.  So let's talk about a very concrete question:  How do I determine whether two given topological spaces are homeomorphic?  (Variants are "... are isometric" and "... are diffeomorphic".)  In the area I study (3 manifolds), this is a difficult question.
(There are other questions one could ask about a space.  I am confident that the study of the functions definable on the space reveals information relevant to answering those questions.  Rather than try to vaguely encompass the range of such questions and revealed information, I am only going to focus on one question and, close to the end of my discussion, will restrict the scope a little further.)
Let us look into the study of functions on 2-manifolds (because it is usually easier to sketch examples and visualize what is going on).  A simple 2-manifold is the disk.  There are very few obstructions to just putting any function you like on the disk.  But now let's make a quotient, identifying two segments on the boundary of the disk -- this makes our space homeomorphic to a finite cylinder (also to an annulus).  We have just acquired a boundary condition: the function values along those two segments have to agree (otherwise our "function" violates the vertical line test on the identified segments).
If one imagines an ant walking on the graph of the function along a straight line in the disk through a point in one segment and its identified point in the other segment (I'm using the metric properties of the embedding of the disk in $\Bbb{R}^2$ to define this path -- but that this path exists should be clear from the homeomorphisms with the cylinder or annulus, above.) any function on the disk with identification is periodic on that path.  There were paths that did this on the disk  -- any closed loop does this.  But any closed loop on the disk can be contracted to a point.  Once the ant realizes it has arrived at a point it has visited previously on the loop, it can deflect slightly, keeping one hand (tarsus?) on the previously visited points and slowly spiralling in to a point.  This doesn't work on our disk with identified segments -- which is perhaps easier to see on the finite cylinder or the annulus -- eventually the ant shrinks the loop down until it runs along one of the boundary components and it can shrink no further.  If the ant tries to shrink on the other side of the original loop, it is obstructed by the other boundary component.
So forced periodicity in the set of functions definable on the quotient space has signalled that our space is not the disk: it's fundamental group has at least one nonidentity element.  Perhaps it is or isn't clear from the name, but the fundamental group is an important property of a topological space.  It is a homeomorphism invariant, meaning that all the images of a space under various homeomorphisms have the same fundamental group.  In (geodesically complete) hyperbolic 3-manifolds, the fundamental group is a complete classifying invariant.  So two hyperbolic 3-manifolds are homeomorphic if and only if their fundamental groups are isomorphic.  (This is not true for non-hyperbolic 3-manifolds.  For instance, there are pairs of nonhomeomorphic lens spaces with isomorphic fundamental groups.  In some sense, lens spaces are too simple/symmetric to have unique fundamental groups.)
Summing this up: the collection of functions defined on a 3-manifold gives us information about its fundamental group.  For hyperbolic 3-manifolds (which are "most" 3-manifolds) this information completely specifies which homeomorphism class the space represents.
