Yes, the target can continue its charge move towards you. There's nothing in the rules to say that you have to "declare" how many squares you are charging.
You must pick the square you are charging to. How else will you know if that square is occupied before you charge? The rule clearly states if the nearest square (i.e. the one it states you must move to) is occupied, you cannot charge. Picking the square and determining if you may charge implicitly determines the charge distance. No you do not need to declare the distance, but you must determine the target beforehand so the square you must charge to is determined at the start of the charge.
I also think that you can redirect the charge, as there doesn't appear to be anything specifying that you must "declare" your target in advance and cannot alter it.
Again, if you don't pick a target, how will you know if the nearest square to the target is occupied before you start your charge? Clearly, you must pick a target before you charge.
The rule also says, "If you leave a square adjacent to an enemy, that enemy can make an opportunity attack against you." That means, when the part of the rule addressing movement mentions 'towards the enemy', it means a
specific enemy you are charging, not 'the enemy' in general. Otherwise, you would never be able to leave a square next to an enemy to cause an opportunity attack, because that square would certainly be "the nearest square from which you can attack the enemy", which, by the rule, would be the square you must move to. Therefore, you must pick the specific target before you charge, in order to determine the nearest square on your move path to that target, whether it is occupied, and therefore whether you can charge at all.
All the above adds up to mean you must pick the target before the charge starts. Once you reach the nearest square...the square the rule says 'you must move directly to', the move portion of the charge is over. You are correct that the rule does not state you must declare your target, but it does specify that you must determine the nearest square to it, which is the same thing as declaring your target.