Can you tell me if throughout pregnancy sex is safe or not?

Safe sex. Some women who have regular and predictable cycles can use the "rhythm method" to prevent pregnancy, but failure rate is high. You would need to know the length of your cycle for at least 6 months to see if you are regular. From your cycle you can determine your fertile days. There are apps on smartphones that can help but see your Dr 1st to make sure you are doing the calculation correctly.
Safe. unless you have certain pregnancy complications, you can continue sexual activity throughout the pregnancy.