I've noticed a shaking noise while biking at speed recently, after a tube repair and brake cable adjustment (???) Labor Day (I love Chinese places). This thing fell off my bike; only thing keeping it on the bike is a cable and the chain. What do?

By the way this isn't anything expensive or fancy, so I'm assuming just putting it back on and adjusting it would do.

UPDATE: Found out that the derailleur hinge just fell off. Put a bolt on it, don't really expect miracles with that repair. Another question: Should I replace it?