The word "dancing" is being used as a participle in the sentence: "The dancing bear was part of the circus act."
In this sentence, "dancing" functions as an adjective describing the noun "bear." In the other sentences, "dancing" is either part of a gerund phrase ("Dancing is unusual for a bear") or serving as a verb ("as it was dancing").