How electronic components like diodes, capacitors, resistors are added to CPU?
Basically they are fabricated in the same way as transistors.
If you look at the structure of a MOSFET, you will see that it actually has everything you need for resistors, capacitors and diodes.
The channel is made of P-type and N-type doped silicon forming two PN junctions - in fact this can be imagined as two back to back PN junction diodes. So how do you make a diode? you just remove one of the junctions leaving yourself with a PN diode. You can also make Schottky diodes using a metal-semiconductor junction if it is designed correctly. This is also something found in MOSFETs - you see metal joining the source/drain which is essentially a metal-semiconductor junction - though it is designed to not be a diode by diffusing the metal into the semiconductor, but still it's the same structure.
Now look at the gate of a MOSFET. It is a metal-oxide-semiconductor junction (in fact it can also be poly-oxide-semiconductor). The oxide acts as a dielectric forming a capacitor, hence you see talk about gate capacitance for a MOSFET as an important parameter. So you have your capacitor.
Look at the channel of the MOSFET. When conducting, it acts as a resistor. In fact the metal layers themselves are so thin they have a notable resistance, and poly-silicon can also be used as a conductor with quite a high resistivity.

So lets look at the components individually.
Diode
There are different sorts of diodes, of which P-N and Schottky are two common types. How are they made? These are made with the same techniques as a MOSFET. To make a P-N you dope one bit N-Type and a bit next to it P-Type and you have a P-N junction. For a Schottky diode you dope some N-Type silicon and build a metal junction on top.
Resistor
How do you make any resistor? Simply make a trace of resistive material of a specific width and length. This can be poly-silicon or metal in a CMOS device. The former is good for high resistance, the latter for low resistance.
Capacitor
There are two sorts, trench and metal. In the case of trench capacitors you etch down into the silicon, deposit metal, then oxide, then more metal. This forms a relatively high capacitance (for its size) which are commonly used for DDR memory. You can also form metal capacitors using the interconnect layers - basically the interconnects are layers of metal separated by a low-k (low capacitive) oxide layer. If you make that oxide with a higher dielectric strength, you can make a higher capacitance.