Think of Goemon as that best friend who's always naysaying stuff and finding things wrong about a situation. He's a bit of a complainer, and also not very imaginative. Or, not in a positive way—he can totally imagine the worst about things, though. For instance, Goemon definitely doesn't think Manjiro should go to America. Here's why:
"They'll never accept you, Manjiro. If they were to come to our country, they would be killed! And that's what they will do to you. As soon as you set foot in America, if you ever get that far, they'll cut off your head off and put it on a pole, warning other Japanese people to stay away. They're all like that crazy man—that Jolly. They all hate us! You'll see.'" (2.11.47)
To Goemon's credit, the guy he's referring to is Jolly—a pretty brutal character who, in the context of this passage, just jumped the two boys. But Goemon's a little dramatic about what may happen to Manjiro in America, especially considering Captain Whitfield has been nothing but nice to Manjiro and the Japanese boys, Goemon included.
But we all need a little gremlin around sometimes; Goemon helps to balance out Manjiro's super-upbeat vision of things. And, in doing so, he helps Manjiro really shine. We wouldn't know how brave his optimism is at times without Goemon around to conjure up the worst case scenario.