It's the other way around: when you differentiate both sides of an equation, you should be concerned about creating solutions. This is because $f'(x)=g'(x)$ only implies $f(x)=g(x)+c$ for some $c$. So any solution to the IE will satisfy the DE but not the other way around.
In effect the IE has the boundary conditions built into it in a way the DE does not. This isn't totally obvious, so let's walk through it in your example.
Substitute $x=0$ into the original IE to see $f(0)=0$. Differentiate once to get
$$f'(x)+\int_0^x f(y) dy=3x^2$$
and then substitute $x=0$ to get $f'(0)=0$. Thus the IE* implies the ODE IVP $f''(x)+f(x)=6x,f(0)=0,f'(0)=0$, which has a unique solution as you probably already know.
To see the ODE IVP implies the IE, you run the procedure in reverse:
$$\int_0^x f''(y) + f(y) dy = \int_0^x 6y dy \\
f'(x)-f'(0)+\int_0^x f(y) dy = 3x^2.$$
Use the initial condition:
$$f'(x)+\int_0^x f(y) dy = 3x^2.$$
Now you integrate again:
$$\int_0^x f'(y) dy + \int_0^x \int_0^y f(z) dz dy = \int_0^x 3y^2 dy \\
f(x)-f(0) + \int_0^x \int_0^y f(z) dz dy = x^3.$$
Use the other initial condition:
$$f(x)+\int_0^x \int_0^y f(z) dz dy = x^3.$$
This looks different from the original thing, but it is actually the same. One way to make it look the same is to use integration by parts together with the initial conditions on the outer integral of the second term. Another way is to interchange the order of integration; after the interchange you can simply do the inner $dy$ integral since $f(z)$ doesn't depend on $y$. The fact that these both work is a quite general thing, cf. https://en.wikipedia.org/wiki/Order_of_integration_(calculus)#Relation_to_integration_by_parts
* Technically you need the IE and a $C^2$ assumption to run this calculation. The shortcut way that I can think of to get this regularity assumption is to just assume it up front, check that the solution you get has the desired regularity (which it does) and then study the general uniqueness theory of the IE (which in this setting is the Fredholm alternative) to conclude that you didn't miss any irregular solutions.