The use of Undercover police are a legal and effective means to stop rioters causing further damage. It has long been a practice frequently used in different parts of the world to control many protests.
Records reveal that the NYPD sent undercover officers to Black Lives Matter protests (Source)
Many activists were furious that the HKPF deployed undercover police and have framed them as rioters. Some have accused them of initiating and and even encouraging others to commit criminal acts. .
Apple Daily posted the picture below on 28th Sept 2019, falsely claiming that undercover police were hitting anyone they see in Sheung Shui.
They tried comparing police in different parts of the world in uniform with undercover police and commented people with mask and weapons are likely to be police, hinting that only Hong Kong Police uses undercover police.
They are wrong. Undercover police is commonly used in different parts of the world in protests. It is legal and effective.
Here's some articles of undercover police in UK, US, Spain and France:
Rumours to portray police as rioters is propaganda to create hatred against police and it's also used in France yellow vest movement. https://observers.france24.com/en/20181204-analysis-rumour-undercover-police-france-yellow-vests
UK have spied on more than 1,000 political groups since 1968: https://www.theguardian.com/uk-news/ng-interactive/2018/oct/15/uk-political-groups-spied-on-undercover-police-list
Spanish police admitting using undercover police to infiltrate protests https://www.elnacional.cat/en/politics/undercover-spanish-police-protest-supermarket_436050_102.html
US undercover police mistakenly attacked by riot police. Mistakes happen sometimes.