History as taught where I live, says Brazil only joined WW1 because Germany attacked random civilian boats, not only hitting them with torpedos, but shooting survivors on the water too.
Is this true?
What was the point of it? What the german military hoped to achieve doing that?
Short answers first:
Longer answer:
One of the first things Britain did was begin a blockade against Germany. There is some dispute as to exactly how effective this was, but it definitely caused shortages and privations in Germany (among other things, the Germans stopped drinking coffee made from coffee beans and started drinking one made from acorns instead). The German surface fleet didn't really fare all that well against the British - there were a couple of victories early in the war (such as the Battle of Coronel in 1914), but the usual result of a German victory outside of the two great Dreadnought fleets was the Royal Navy hunting down and destroying any German ships that managed some level of success.
What the Germans were left with to try to knock Britain out of the war (which on land was a stalemate) was U-boat warfare. Now, there are two ways of doing this - restricted warfare uses prize rules (the submarine surfaces, searches a ship for contraband, and if some is found, allows the crew to leave and then sinks the ship), while unrestricted involves sinking ships on the spot. Restricted submarine warfare is far more dangerous to the submarine, which is why much of the German admiralty wanted to use unrestricted warfare instead.
The Kaiser flirted with it (and until 1917-1918, wasn't really on board with the idea, and while the British blockade against Germany annoyed a lot of neutral countries, the German blockade against Britain was the one that was sinking ships and killing people), but in the end, Germany began using unrestricted warfare despite the risks - they honestly thought that they could knock Britain out of the war before countries like the United States had a chance to get involved.
(It goes without saying, but they were wrong.)
As far as shooting survivors on the water, that didn't really happen. Even in World War II, there was only one confirmed case of a U-Boat captain machine gunning survivors in the water. The problem was that there wasn't any space on a U-boat to carry survivors, and if there were British ships around, there usually wasn't time to surface and try to provide rations and medical supplies (which was a far more likely interaction between a U-boat and survivors in the water). That said, exposure in the water kills people pretty quickly, so there was a still a marked body count.