What is the definition of temperature, once and for all? Can someone please explain to me what the formal definition of temperature is?
Neither my textbook, nor my professor, nor any of the online sources I've checked are able to give me a proper definition of temperature. Even Feynman doesn't define temperature. Honestly the amount of circular definitions and ambiguities I've encountered in trying to understand the precise definitions of thermodynamic concepts is astounding.
The best thing I got was the temperature of a system of particle is a measure of its average kinetic energy.
In deriving the ideal gas law for monoatomic gases, the derivation of the internal energy formula $U=3/2PV$ is clear to me. However then it is used that the average kinetic energy of a system is given in terms of its temperature as $3/2kT$. For a monoatomic gas, the total energy is simply the number of molecules $N$ multiplied by the average kinetic energy (since the molecules are assumed to have no rotational energy), and thus $U=3/2NkT$, which gives $PV=NkT$ which is the ideal gas law.
So am I to take the statement that the average kinetic energy of a system is equal to a constant multiplied by its temperature $T$ as a definition for temperature? I don't think so because this is in fact the equipartition theorem, which means temperature must be defined independently elsewhere.
So what is the proper definition of temperature in thermodynamics and kinetic theory, and furthermore, why is it that when we place a thermometer in a bath of water we can say the reading we get is a measure of the average kinetic energy of the molecules in the bath?
 A: Here is the definition of temperature in thermodynamics:


*

*the first law defines the heat $Q$ as the "missing" energy
$$ \delta Q = d U - dW \tag{1}$$
where $U$ is the total (inner) energy and $W$ is the work.


Note however that the heat is not defined for a state of the system but you need to know the process (path) by which you have reached the present state. That is to say only the change $\delta Q$ is defined in (1) and not $Q$ itself.


*

*in the second law, the (absolute) temperature $T$ is defined as the integrating factor that renders $\delta Q$ into a total differential $dS$. In more physical terms, it is the factor that makes out of $\delta Q$ a quantity $S$ that only depends on the state of the system 
$$ dS = \frac{\delta Q}{T}. \tag{2}$$


Via (2) the temperature is defined up to a multiplicative constant. This constant is usually defined (via the Boltzmann constant) in such a way that there are 100 units between the freezing and boiling temperature of water at ambient pressure.
Edit:
Thanks to Valter Moretti I have figured out that you have to add the condition to (2) that $S$ has to be extensive. 
A: Since Fabian gave you a thermodynamical perspective, I will try to give you the point of view of statistical physics. You actually got very close when you cited the equipartition theorem since the general picture is very much that.
Ultra terse version: temperature is the inverse of the Lagrange multiplier ensuring the conservation of energy in the maximisation of the statistical entropy.
I am going to stay in a classical framework so that I don't need to overwhelm you with the quantum mechanical machinery of the density operator. Let's say we have a system of $N$ particles. We give ourselves a phase density $D(x_1, p_1, x_2, p_2, \cdots, x_N, p_N)$: the probability that the i-th particle has a position between $x_i$ and $x_i + \delta x_i$, and a momentum between $p_i$ and $p_i + \delta p_i$ is proportional to $D(x_1, p_1, \cdots, x_N, p_N)\delta x_1 \delta p_1 \cdots \delta x_N \delta p_N$. Then we construct the statistical entropy $S(D)$. This is therefore a functional, i.e. a function of the function $D$:
$$S(D) = -k \int dx_1dp_1\cdots dx_Ndp_N\ D \log D$$
where I did not write the arguments of $D$ for readability.
Now the game is to find $D$ that maximises $S(D)$ under the constraints that some macroscopic quantities are known. The simplest example is that of the canonical ensemble where the macroscopic energy $U$ is known. 
$$U = \int dx_1dp_1\cdots dx_Ndp_N\ D\ u$$
where $u(x_1, p_1, \cdots, x_N, p_N)$ is the microscopic energy for the given point in phase space. For example, for the perfect gas, we can take into account only kinetic energy,
$$u(x_1, p_1, \cdots, x_N, p_N) = \sum_{i=1}^N \frac{p_i^2}{2m},$$
where $m$ would be the mass of each molecule in the gas.
That constrained maximisation is then transformed in an unconstrained one by actually maximising
$$S(D) + \beta U + \lambda_0 \int dx_1dp_1\cdots dx_Ndp_N D$$
where $\lambda_0$ is introduced to enforce the constraint, always present, that $D$ has to be normalised to 1 so that the probabilistic definition above make sense. $\beta$ and $\lambda_0$ are called Lagrange multipliers. The result is that 
$$D = \frac{1}{Z} e^{-\beta u}$$
where the normalisation $Z$ is called the partition function. This is the Boltzmann-Gibs distribution. Finally, we can define the temperature $T$ as
$$\beta = \frac{1}{kT}$$
A: From a logical and thermodyamic point of view, the definition of temperature must be given by the Zeroth Law of Thermodynamics.
Let us say we do not know what temperature is. However, we know that if we let two bodies interact they can change some thermometric properties (such as volume, pressure, electrical resistance,...) of each other. When there is no change at all in any thermometric property, we say that the bodies have achieved thermal equilibrium. The Zeroth Law consists on the empirical fact that if $A$ is in thermal equilibrium with $B$ and $B$ is in thermal equilibrium with $C$, then $A$ is in thermal equilibrium with $C$. This is an equivalence relation which classify a set of bodies into subsets called equivalence classes. We then label each class with a number $T>0$ which we shall call temperature. The Zeroth Law allows us to establish thermal equilibrium just in terms of a newly defined variable called temperature.
The definition above is not absolute though. The number we associate to each subset of bodies in thermal equilibrium is arbitrary. To remove this arbitrariness (at least partially) we use the Second Law of Thermodynamics to define the so-called absolute or thermodynamic temperature. The second law implies that any reversible thermal engine operating between two sources has efficiency given by
$$\eta_R=1-\frac{T_2}{T_1},$$
where $T_1$ and $T_2$ are the temperatures of the sources. Given the universality of this result one can for instance arbitrarily define the temperature of the cold source $T_2$, measure - mechanically - the efficiency of the engine and then the temperature $T_1$ is determined by
$$T_1=\frac{T_2}{1-\eta_R}.$$
Note that there is no longer arbitrariness about the concept of temperature, except for the choice the the temperature of the cold source. Therefore it is appropriate to use as reference point which is highly reproducible anywhere. A standard choice is the triple point of water which is defined to be at $273.16\, \mathrm K$.
A: Mathematical:
$$T = \frac{\partial U}{\partial S}_{V,N}$$
Temperature is the change in internal energy with respect to the entropy when holding the volume and number constant.
Plain English: Temperature is a measure of the free energy in an object. Different objects have different capacity to hold energy. For example, at room temperature, ammonia can hold about 10 times the energy as gaseous argon (per gram). Complicating things further, a material's capacity to accommodate free energy changes with the temperature. Rather than merely reporting the free energy in an object, temperature reports the free energy normalized to how much capacity that object has at that temperature. All of this brings us back to that definition that feels very circular and doesn't really explain much out of context: 
Heuristic: temperature is the quality of matter that is the same when objects in contact reach thermal equilibrium. 
Mechanistic revision: You've heard about the movement of molecules in a gas and the wiggling of atoms in a solid, and that's a way to understand things, but there's also photons and (mathematical) phonons which give things temperature. It turns out that we know the temperature of the sun not because we sent a thermometer, but because it radiates photons just like everything else, and the frequency distribution of the outgoing light is consistent with the surface of the sun being at about 5800K. We even know that most of space has the consistent temperature of about 3K because of the same property.
Editorial: Energy goes from object to object and type to type all the time. Energy is an abstract concept that relates every physical science (and describes hundreds of forms of energy), so we can't really expect its derivative with respect to Entropy to be just one phenomenon. Keep exploring. 
A: What is temperature? There are very formal mathematical answers to this question. However, the best answer I have encountered in my six years of physics education was in my original thermodynamics course my second year, in Schroeder's Thermal Physics, pages 85-91. However, my understanding has evolved with exposure to probability and information theory.
Temperature is unambiguously defined as "how much a system's entropy changes when that system's energy changes."
Thus whatever understanding of temperature one wishes to obtain is fundamentally limited by their understanding of what entropy is. Entropy is a measure of how much information (in bits, since we're on computers right now) is required to know the state of a system.
A system's state (really, quantum state) is everything that can possibly be simultaneously known about a system. Once you know everything there is to know about a system, you have determined its state.
Entropy is equivalent to the expected number of yes/no questions minimally required to determine the state of a system. Please note the word "expected" (which means average), and the word "minimally"(which means asking the best questions you possibly can).
You probably have never heard this definition of entropy, but this definition is actually completely correct, except in physics we multiply this number by $k_b ln(2)$ (a number) merely for historical reasons. So whenever you read entropy, you should try thinking expected number of yes/no questions. If you don't know if a coin is heads or tails, the entropy is 1 binary question: "Is the coin heads?".
There is a simple law saying the expected number of yes/no questions required to determine the state of a closed system can never decrease. This is known as the 2nd Law of Thermodynamics. It's a cool law. And when entropy is defined as the expected number of questions, it's an exact law that always holds. It even holds for Maxwell's Demon.
The expected number of questions to determine the state of a closed system can certainly increase. And it certainly will, until it hits a limit. A system that has hit this "limit of unknowability" occupies every possible state with equal probability, and I call this system ergodic. This always happens if you wait long enough, thanks IMO to the mathematics of markov chains (every closed system is necessarily an irreducible, ergodic markov chain that approaches a stationary distribution). This is called the ergodic hypothesis in physics.
Consider two ergodic systems, one high temperature and one low temperature.
When a system has high temperature, it means that small changes in the system's energy cause large changes in the system's entropy (in fact, this is the definition of temperature). Thinking about entropy as the expected number of yes/no questions, this means your going to have to ask a lot more questions to determine the state of the system if you add a little energy.
When a system has low temperature, it means that small changes in the energy of the system do not change the entropy of the system very much. You're not going to have to ask significantly more questions to determine the state of the system if it has a little more energy.
Now consider the combined system, closed off from the rest of the universe. The 3rd Law places a restriction on the expected number of yes/no questions to determine the state of the combined system. Consider what happens if the systems can exchange energy (and only energy!).
If energy is not exchanged between the low temperature and high temperature systems, then the expected number of questions required for the whole system $N_{1+2}$ is just the sum of the expected number of questions for each subsystem: $N_{1+2} = N_1 + N_2$.
However, what happens if the two subsystems can and do exchange energy? The 3rd Law says that, whatever happens, the expected number of questions required to determine the state of the combined system cannot decrease.
If you know that more energy flowed from the high temperature system to the low temperature system (which it certainly can, energy flows randomly), you know from the definition of temperature that the number of questions required to determine the state of the combined system has decreased, in apparent violation of the 2nd Law: $N_{1+2} < N_1 + N_2$. However, this knowledge about "backwards flow of energy" cannot be obtained without asking a certain number of questions $N_q$ of the system: the exact number required by the 2nd Law $N_{1+2} \geq N_1+ N_2 + N_q$.
On the other hand, if all you know is energy exchange is occurring in this combined system, from the ergodic hypothesis the expected number of questions you'll have to ask is only increasing, rapidly approaching the ergodic limit. This requires that energy flows on average (randomly) from the hot thing to the cold thing. And the ergodic limit is when the hot thing and the cold thing are the same temperature.
