What is this chip attached to DC motor
That is not a "chip."

It is a printed circuit board.  Commonly called a PCB.

It contains several parts.  They are most likely nothing more than capacitors intended to reduce the electronic noise produced by the motor.  Not "noise" like you hear with your ears, but noise that can interfere with radio operated devices or other electronic devices.

They are most likely using a small PCB because it was cheaper that way than the old fashioned way of hand soldering a couple of capacitors to the motor.  Like this:



There is no way to tell from the picture what voltage it is designed for.  There may be a marking somewhere, but I doubt it.

Take a look at whatever toy it came out of.  If it has a couple of batteries in series then the motor is probably made for three volts.

It isn't critical, though.  A 3V motor driven by 4.5V won't explode.  It will run faster, get hotter and wear out sooner.  Well, it was doing no good anyway in a broken toy so any use you make of it is a win.

DC motors can easily be used as generators.  Spin the shaft, and you will get DC at power terminals.

Nasty, pulsating DC whose voltage changes with RPM. But, DC.  

Probably not much current, but you could probably manage to light an LED with it if you can spin the shaft fast enough.



Going by the colors, a couple of the parts on there are probably inductors.

Inductors together with capacitors can be used to make a better filter than just capacitors. 

That's another reason to put the parts on a PCB.

A filter made of capacitors and inductors is a little more complicated than just capacitors, so you make a PCB and have it machine assembled instead of relying people hand assembling it properly. Hand work is more expensive than machine assembly, and more error prone.  This way your underpaid, poorly educated peons only have to slap a pre-made PCB onto the motor instead of trying to remember how to assemble six little parts into a functional filter on each and every motor.



The main circuit board has several parts with voltage ratings, but all that tells you is what voltage you shouldn't exceed.  It doesn't tell you the operating voltage of the circuit.

Take the little metal cans.  Those are large value capacitors, and are marked 10V.  So they can be used at up to 10 volts.  But they can also be used at any voltage below that.

The main chip on that board is covered in a blob of epoxy.  Another way of saving costs.

You buy the bare chip, and save the cost of the manufacturer making a proper IC out of it.  The manufacturer doesn't have to put it in a lead frame, pot it in epoxy, or attach the pins of the IC to the pads on the chip.  Or test the finished part, for that matter.

The company building the toy glues the chip to the board and bonds the chips pads straight to the PCB. If it doesn't work: oh, well. Toss it and make another.  They are (almost) literally cheap as dirt - machine assembly makes it possible.