✔ 最佳答案
You are correct that if a 改為 the means pointing at a specific friend. In this sentence, a is correct as you are describing a general point of view.
We use a when we describe something in general and we use the to describe something specific.
Example for using a, a car (the correct word should be vehicle) is usually more expansive than a motorcycle.
Example for using the, the car in the showroom is more expansive than a motorcycle.
Note: Please note that 卑劣的行為 is depicable behaviour. So, correct sentence should be written as
To betray a friend is a depicable behaviour.
Hope this helps.
Francis from Canada