A badge was an insignia which could be a symbol of authority, responsibility, or membership of an organization. (DS9: "Trials and Tribble-ations")
The mascot of Tribbles Spicy Ranch cereal wore a cowboy hat with a sheriff's star-shaped badge pinned to it. (ST: "The Trouble with Edward")
The badge worn by many generations of Starfleet personnel was shaped like an arrowhead. Like the uniform, it showed the division in which one was serving. In the 24th century, this badge was integrated with the communicator to become the combadge. (TNG: "Encounter at Farpoint", et al.)
In the mid-23rd century, two types of distinctive Vulcan badges, including the IDIC, were worn by graduates of the Vulcan Science Academy on their graduation day. One of these badges was worn on the left breast of a white cloak and the other, the IDIC, was worn near the neck, clasping the front of the cloak together. (DIS: "Lethe")
The medicine badge was a badge adorned to a headband which was worn by the medicine chief of the Amerind inhabitants. (TOS: "The Paradise Syndrome")
As of 2399, visitors to Starfleet Headquarters were issued badges identifying them as visitors. (PIC: "Maps and Legends")