This question already has an answer here:
I'm looking for a story I read about twenty-five or thirty years ago, in a book I got in a second-hand store. I don't remember the title of the book, which had a number of short stories in it, but in the specific story, there is a law that a robot's memory must be wiped every hundred years. This robot doesn't want to lose its memories, so it stows away on the outside of a spaceship. The spaceship's entry to hyperspace has some effect on the robot's mind. The spaceship lands on a planet with a corrosive atmosphere, and as the robot moves about the world, it starts getting flashes of schematics every time it closes its eyes. Eventually it realizes that these schematics are actually the schematics of whatever it's looking at, and that by imagining a change to the schematics that it sees, the thing itself is changed. It uses this ability to temporarily disable another robot of the same model as itself (and steal that robot's scheduled body replacement), and it stows away on another spaceship, which it also repairs, and it also actually heals an injured/ill human who is on that spaceship.