If I try to enter a square with a ship from a different race, does that mean I attack them? |
If so, how do I tell them it was a mistake
?

Um...
If you're in the same hex as a race that you don't have a "non-combat" treaty with (there are various ways to achieve that) combat always starts automaticly, even if it was through move or attack. Its just that the "move" command trys to avoid fights (in fact, the move comand can NOT be used to start fights *unless* you don't see the ship untill after you're in its hex, i. e. because of warping through a warp point, or (probably) if you have scanners that are just that short ranged).
There are 10 types of people in the world:
Those that understand binary, and those that don't.
But thats them attacking you
In that situation it’s the AI Empire which attacks you for blundering into it but barring that it is more than possible to have multiple ships from different empires in the same hex.
Where are these "non-combat"
Where are these "non-combat" treaties? I searched the entire manual for "non-combat" and nothing was found. I am having a problem right now with a friendly empire. They have a few ships sitting on a wormhole I want to travel through and the system won't let me move into that square. I am not sure how I need to alter the treaty to allow me to coexist with them on a hex peacefully.
Non combat
The clause you want is one of the options under Non agression which alows ships of diferent races to coexist in the same sector




No
As far as I am aware the only way to attack ships of an other race is to issue an attack order. However being that close may result in them attacking you as seems to happen with the neutral empires with fleets at the warp point that jump your scouts.
The only way to apologise is to send them a general message or to propose some sort of non aggression treaty I am not sure how this works with AI empires but you can apologise to other human players quite easily