함께하다 means "share (with), join (with)·
함께 하다 means "do something together"
ex)
I will accompany you on a trip to Seoul.
서울 가는 여행에 나도 함께할께.
She participated with her friend in her sufferings.
그녀는 친구와 괴로움을 함께했다.
The man and woman slept together.
남녀는 잠자리를 함께 했다.
We used to be in the same business together.
우리는 같은 사업을 함께 하곤 했다.