The FSA can only pay for expenses incurred after it was open. This also applies in case of a mid-year change in election (such as due to marriage, divorce, child birth, etc.)
For example, according to this page:
You can only be reimbursed for qualifying expenses, from the election that was in place at the time the expense was incurred.
So, say you had $500 available from January to June, then on July 1 had a qualifying event, you then elected $2000. You can be reimbursed for up to $500 in expenses incurred prior to July 1, and then an additional $1500 in expenses incurred after (up to $2000 if you didn't use your full $500).
More specifically, from the IRS Publication:
Generally, distributions from a health FSA must be paid
only to reimburse you for qualified medical expenses you
incurred during the period of coverage.
The HSA question is more complicated. I would talk to a tax accountant, or at minimum your benefits coordinator. Also read the publication I linked above, the first part is about HSAs. The short answer to your specific question: stop contributing to the HSA, unless you were contributing well under the limit of the HSA. If you know your limit, and you know you're under it, you can continue contributing until April 15 of next year:
If you fail to be an eligible individual during
2013, you can still make contributions, up until April 15,
2014, for the months you were an eligible individual.
The general rule is you can contribute up to
(1/12)*(your limit)*(number of months you were eligible). So, if you changed jobs Oct 1, and you're single, then you could contribute
(3250)*(1/12)*(9), or just over $2400 in total for the year. If you've contributed less than that to date, you may continue contributing up to that amount - but again, contact your benefits coordinator or preferably a tax accountant, as the rules can be complicated.
You definitely cannot deduct any expenses from the account that you incur after you are no longer eligible, and the rules on distributions are pretty complicated - and if you get it wrong, you may owe a 10% penalty on top of the tax you would normally owe, so there is significant incentive not to get it wrong.