How to upload program to custom arduino board without USB FTDI and making it read only?
I think you cannot prevent overwriting the firmware, neither prevent viewed by others.

However, you can detect that someone overwrites it (besides you), by reading some code from e.g. EEPROM based on the content of your firmware. If you read a different code, than you can act upon it.