Answer:
An example of a cubic function with exactly 2 real roots:
f(x) = x^3 - 5x^2 + 8x - 4
This function has the following real roots:
x = 1
x = 2
The graph of this function is shown below: Attachment
As you can see, the graph of this function intersects the x-axis at 3 points, which means that it has 3 roots. However, 2 of these roots are the same, so the function actually has 2 distinct real roots.
The graph of a cubic function with exactly 2 real roots will always have 3 points of intersection with the x-axis. However, 2 of these points will be the same, so the function will only have 2 distinct real roots.