Wiring a plug. Non UK coloured wires
UK wiring colours

        Live    Neutral
        ----    -------
 Old    Red     Black
 New    Brown   Blue


Appliance leads changed colours first, this was so that appliances across the EU all conform to the same colour code. Aiding trade etc.

Later on, in-wall fixed wiring colours were changed. I guess this was deemed less urgent because houses don't get moved from country to country.

Anyway that might explain why you have a mix of colours. The in-wall wiring uses the older colours. The appliance (fan) wiring uses new colours.


  I am trying to wire a plug into a 6" inline fan for our bathroom


The way you phrase this makes me unsure what exactly you are doing.

If this fan is inline in the sense of part-way along an air duct, it should be wired in permanently and not using any kind of plug (as in wall plug that plugs into a wall socket)


  why is red and brown connected off like that?


Live supply (red) to live load (brown). Probably.

It is unusual for that to be on a separate connector like that, which suggests something odd may be going on.

Normally there is the typical white-plastic screw-down connector block as shown at the bottom of your photo with all the supply connections on one side and all the appliance connections on the opposite side.

What you have is non-standard (but might still be OK and safe - its just hard to tell from the photo alone)


  Which one is neutral?


Should be blue (appliance side) and black (supply side).


  I am assuming I can leave off the earth


It isn't needed for double-insulated appliances (like your fan) but you should terminate it somewhere so that a future householder is able to safely connect a different type of fan that does require an earth.


  I do not recognise the colours used


Apart from the above explanation, you should refer to the manufacturers instructions. Many bathroom fans operate when the bathroom light is switched on and continue to run after the bathroom light is switched off. To be able to do this they need the following connections


neutral
permanent live
switched live
(earth unless double insulated)


The electricians who put wiring into walls often use standard cabling for the run to and from the light switch etc which can mean that a blue cable acts as a switched-live return from the switch. This should be marked with red tape (or really brown tape nowadays) to indicate it is a switched-live not a neutral.

If in doubt, you'll need a suitable Cat-II (or greater) rated voltage-test device and spend some time confirming what wires do what.



From your comments, what you have are


white sleeved cable


red insulated wire   (normally indicates live)
black insulated wire (normally indicates neutral)

black sleeved cable


brown insulated wire (normally indicates live)
blue insulated wire  (normally indicates neutral)
black insulated wire (not normally used in homes)



The last combination is used on three-phase industrial supplies that are rarely seen in UK homes. In that case brown is phase 1 and black is phase 2 (phase 3 would be light-gray). It is exceedingly unlikely that a domestic bathroom fan would use a multiple phase power supply.

If I didn't have instructions for the fan, I'd try to obtain some from the supplier or manufacturer (or intertubes). Failing that I'd break out the suitably rated test tools and try to work it out the hard way.