What is mathematical logic? What does mathematical logic mean?
In the book Analysis 1 by Terence Tao, it says:

The purpose of this appendix is to give a quick introduction to
  mathematical logic, which is the language one uses to conduct
  rigourous mathematical proofs.

Checking Wikipedia:

Mathematical logic is often divided into the fields of set theory, model theory, recursion theory, and proof theory.

This seems like a completely different definition. Why, for example, is set theory considered part of logic?
 A: Mathematical logic is a strange beast.
It is a perfectly ordinary branch of mathematics whose goal is ... to study mathematics itself. 
Thus, the different branches of mathematical logic are devoted to the study of some basic building blocks of mathematical practice : language, model, proof, computation.
A: Logic is generally understood to be the study of sound reasoning. Mathematical logic in the sense Tao uses this word is the kind of logic one uses when doing mathematics. This includes dealing with logical connectives (such as "and", "or", "if", and "if and only if"), quantifiers ("for all" and "exists"), variables, and proofs.
But, as it sometimes happens in natural languages, one and the same word can have two (or more) different (though sometimes related) meanings. This might be the cause of your confusion. In fact, mathematical logic can also mean the branch of mathematics that deals with formulae, theories, proofs, models, … as mathematical objects. Of course, as all other branches of mathematics do, this branch of mathematics also uses mathematical logic in the former sense.
The reason why some people regard set theory as a subfield of mathematical logic$^*$ in the latter sense is that these fields are historically quite related. You may be interested to learn about the foundational crisis. I found a talk given by mathematician Chaitin that gives a good overview over this topic: see Part 1, Part 2, Part 3, Part 4.
By the way, the appendix on logic is included in the sample chapters of Tao's book.
$^*$ But at the end of the day this is just a termininological convention.
EDIT: This answer is just a restatement of Henry's comment:

Terence Tao's 31 page appendix is really a description of the basic language and tools of mathematical proof to help understand the rest of the Analysis I book, rather than the deeper subject of mathematical logic. The sections are called: Mathematical statements; Implication; The structure of proofs; Variables and quantifiers; Nested quantifiers; Some examples of proofs and quantifiers; Equality.

A: The names and scopes of areas of mathematics are not always crisply delineated. In this case set theory is a bit of a grey area. There's an argument for considering it part of the broader subject of mathematical logic, but there are many set theorists who wouldn't consider themselves logicians.
Likewise, whether recursion theory is part of logic or computer science depends on who you ask.
That being said, the two descriptions are not in conflict. The four subfields that Wikipedia lists are all ingredients of the study of "what a rigorous proof is" and what rigorous proofs can and can't achieve.
Proof theory and model theory are both unquestionably part of logic.
Set theory is part of the common language of mathematical proofs -- it is used as a general way to speak about the things of actual interest in whatever your field is.  Figuring out the appropriate rules for how set theory can be used therefore (arguably!) belongs as part of the study of common features of mathematical proofs in general.
Recursion theory is the study of mechanical computation, and is -- in addition to being the foundation for computer science -- an important technical tool for proving famous results of proof theory, such as Gödel's incompleteness theorem.
A: Mathematical logic means many things, depending on context. In particular, it includes two related areas of study:


*

*Using mathematical to study "logical" topics such as proofs, models, computability, and sets.

*Using those logical topics to study mathematics. 
The quote from Tao only scratches the surface of mathematical logic. It is analogous to calling the elementary facts about sets at the beginning of a textbook "set theory", when the true study of set theory goes much deeper. 
The reason that logic is divided into "proof theory, model theory, computability theory, and set theory" is historical, which is to say it is not based on any kind of rigorous argument. Those four areas were developed during a similar time period, and were all originally motivated by certain foundational issues in math.  Some of these areas and their subareas are still closely connected to foundations of math, while others are less closely connected.  
Over time, as "logic" became its own subfield of mathematics, these topics became more and more fixed as "logic". The Handbook of Mathematical Logic in 1977 crystallized this division into four areas.
Another common feature of the four areas is a focus on formal languages and formal definability. This is not common in other areas of mathematics, where only natural language is typically used. 
The four parts, though, are not intended to be exhaustive. Parts of category theory are closely related in spirit to the other areas of logic, even though category theory is not one of the four areas. Some areas of model theory are much more "mathematical" than other areas of mathematical logic.   So the entire idea of dividing "logic" into four parts has to be taken with a grain of salt. 
A: Mathematical logic involves three steps:


*

*Axioms: "Let's agree to the fact that this essential property is true.  And we will all consider it true for the sake of building these mathematics.". 

*Definitions: "Let's define these mathematical objects $\mathbb{O}$ as those with these axiomatic properties" defined in 1), and we will all to some extent agree for the sake of working together.

*For the object defined in 2) $\mathbb{O}$, let's see how far we get by using the fact that "$\mathcal{P}_1 \overset{logic}{\Longrightarrow} \mathcal{P}_2$", where $\mathcal{P}_1 $ is a property of $\mathbb{O}$ given in 2).


Here $\overset{logic}{\Longrightarrow}$ is the reasoning that leads to property $\mathcal{P}_2$ by arguing saying:

"If $\mathbb{O}$ does verify  $\mathcal{P}_2$  then  we are
  negating the fact that $\mathbb{O}$ verifies $\mathcal{P_1}$. But we
  all agree to the fact that $\mathcal{P_1}$ holds, so let's say
  $\mathcal{P_2}$ does not hold". Or "$\mathbb{O}$ verifies $\mathcal{P}_2$ and this fact does not conflict with the fact that $\mathcal{P}_1$ is true, so let's say $\mathbb{O}$ verifies $\mathcal{P}_2$".

A: Modern mathematical logic is "mathematical" also in another sense: some branches of it are simply mathematical disciplines, like e.g. Computability theory and Constructive mathematics,
