Has Brazil ever been at war?
Brazil had lots of internal civil wars and revolts in the 19th century. The longest and bloodiest was the Revolução Farroupilha, which lasted 10 years, in which the southermost Brazilian state tried to separate and become a republic (Brazil was an independent Empire with an European royal house from 1822 to 1889)
From 1825 to 1828, Brazil fought the Cisplatine War, which resulted in Uruguay becoming independent (the territory had been annexed, from Spain, while Brazil and Uruguay still belonged to Portugal and Spain respectively).
From 1864 to 1870, Brazil fought the Paraguay War (Triple Alliance War) in which Brazil, Uruguay and Argentina fought together Paraguay and its crazy dictator.
In World War 1, Brazil participation was only about letting mainly the french army to use Brazilian ports and bases, after Germany sunk a few Brazilian merchant ships.
Brazil participated in World War 2, sending 25 thousand troops to fight against the axis in Italy. The US also mounted a base on northeast Brazil. Brazil declared war on Germany after the axis sunk a few ships killing some 1000 Brazilian sailors.