I must stress that there was farming in the UK well before the creation of the EU.
There have been long-established trading relations all over the world particularly within the commonwealth . It sounds blistering obvious, but it is worth iterating this point as some articles published sound as though we would be left without food altogether.
Many companies here in the UK go to great lengths to state their food is made here in the UK , I can not imagine that this will go away anytime soon, perhaps some canny businesses will continue to leverage this one further.
The loss of farming subsidies and price controls understandably would be a worry to many farmers especially when their existence can be so precarious , but with ingenious thinking and some changes in regulation these are problems that can be solved.
What would farmers do apart from farm….?
Some of the land could be moved over to housing as much as NIMBYs protest about excessive house building over the UK , such a small percentage of the country is built on “The urban landscape accounts for 10.6% of England, 1.9% of Scotland, 3.6% of Northern Ireland and 4.1% of Wales.” (http://www.bbc.co.uk/news/uk-18623096) .First on the build list should be farms adjacent to existing housing projects, second on the build list would be the plots of land that were kept profitable due to subsidies or price controls these were most like to have been marginal in the first instance.
The government could also push to remove all the unnecessary administration and regulations that are currently coming from the EU. This would free up farmers to do what they do best which is farm and seeks new markets for goods or to use the land in a new and novel ways.
It is possible to remove all farming subsidies and produce more food at less expense to the taxpayer , who in fact get stung twice one through their taxes and the second through higher food prices. A real world example of this NZ where all farming subsides were removed 34 years year ago ,if anything it seems to have reinvigorated their farming industry (http://news.bbc.co.uk/1/hi/programmes/from_our_own_correspondent/3747430.stm) , if an economy the size of New Zealand can perform such a change , there is no reason why the UK which is much larger economy could also not survive with out farming support
What about making all the food that we need here in the UK ? I don’t want to get into the meat (pun intended) of comparative advantage you can look that up yourself , but needless to say it makes no sense trying to make watermelon here in the UK considering our climate the amount of energy required would not be a good use of scarce resources. It makes much better sense for us to produce where we have an advantage such as making potatoes/financial services/design and engineering etc and trade them for watermelons from a countries where they make them with relative ease .
This sort of trade also allows developing nations to trade their way to prosperity as opposed to waiting for grants from first world nations . Which will come with inevitable strings attached. Trade is much simpler and bottom up way of helping individuals and nations out of poverty. As opposed to the top down method which is fought with money leaking a way to pay bureaucrats with very little making its way to the those most need it. We could do away with departments such DFID and have that money spent here at home or left with the taxpayer.
If we were to be true to our Cobden (google corn laws for more on this much forgotten British free marketeer) core ,then we would also not worry about who makes our food the UK would have the ability to trade outside of the customs union with everyone. The whole world would be able to trade food with us in return for all the goods and services where specialise . As many of the countries outside of the EU would be able to send us food more cheaply (not in all cases I conceded as they may not have scale but that could happen over time as the developing world would accumulate capital from the goods they have sold to us) .
A post Brexit Britain (or just Britain returning to nation-state which is self-governing like most other countries in the world) we need to this as an opportunity to allow all areas of the economy to flourish and experiment (one of the reasons not to integrate all EU law into UK law IMHO) with new ideas and solutions you never know what we may just come up with.