I wonder if a gym can get free after some time (like e.G. 2,3,4,..,n days no action) or by removing defending pokemons (i guess that is not possible but i am not sure?) or other circumstances, or only through winning battles against the defending pokemons? Or will the gym be captured forever if noone tries to lower reputation by attacking?
The only way to remove Pokemon and in turn a team from a gym is by lowering the Prestige of the gym down to zero. Every time you defeat a single Pokemon in the gym, it lowers the prestige by a little bit, with a bonus for defeating every Pokemon in the gym.
To answer your second question, yes, a gym can theoretically be held forever by a single team if no one decides to fight it.
The only way to get a pokemon out of a gym is by defeating it, that is if it is in an opposing team. If no one lowers the reputation of the gym it will belong to team/trainers in the gym until beaten.