A German author and politician has been arrested after social media posts comparing Benjamin Netanyahu to the Nazis.