Working remote in Brazil

I will be flying to Brazil for a month and living with my Brazilian wife. I am a US citizen and we will register our marriage there. I plan to work while I am there from my US company which I do computer IT stuff. Is there anything I need to know from the legal side of things like if I am asked if I am there for work or leisure? Do I need to pay Brazilian taxes or have a form with me? I am inclined to just not say anything but from a company liability perspective I need to do the correct paperwork.

I think you will be fine.  I would say what you wrote and maybe showing proof of marriage and wanting to register marriage in Brazil is a correct answer! They may even offer advice for such.
Would not volunteer working. but it is not illegal to do your work in Brazil on line. If asked just say, "if needed I will do work if US company needs you."

right, i know its a late post but i was doing this for FCA for 2 years till i had to come back to canada, the internet speeds in brazil are suprisingly fantastic  compaired to the outdated tech we use in canada lol ( most places )

Several bits of advice.  I am hoping that the experiences I know about will help you have an easier time.

If you have a source of dollars in the US, hold onto it for dear life.  Wire the dollars to Paypal or a US bank account, pay your taxes in the US, and use an American credit card for local purchases.  The real is an unstable currency, and God help you if you use it to pay bills in the US (student loans, etc.).   

There have been some stories of successful American entrepreneurs in Brazil, but if you want to go that route, be ready for an experience that makes Silicon Valley look like Disney World.  Firstly, Brazilian clients are almost impossible to acquire.  After months of negotiation, full of the most confident assurances, the time will come to draft the contract.  You sign it and wait for them to sign it ... and wait ... and wait.  They were playing you all along, for the sheer pleasure of wasting your time.  From their perspective, if you didn't go to USP or you aren't connected to a mega-rich family, your abilities and qualifications don't matter - you're worthless.

As a friend of mine once told me, Brazil treats its entrepreneurs worse than its criminals.  The time to incorporate in Brazil can be up to a year.  Brazil does have a startup ecosystem, but from my observation most startups are funded by rich kids who weren't allowed to run the family business. 

If you chose entrepreneurship, it is easier to just outsource to the US.

You should also avoid working for local tech companies.  This generally takes care of itself - qualified Americans (even those with legal residence) have a very difficult time finding and maintaining work.  Beneath their smiley facade, Brazilian offices tend to have a very zero-sum mentality - there's a lot of game-playing, lying, stealing credit, sabotaging, etc.  It doesn't have to do with anti-Americanism.
Brazilians have a generally positive view of the US, and I have not once encountered the sort of casual anti-Americanism one finds in other parts of the world.  It's just that the last thing your bosses and coworkers want is a more qualified colleague. 

In the case that a company does want to hire you, tread *very* carefully.  Brazilians are terrific salespeople, and if they want to hire you they will make their company look like heaven on earth - until you sign the contract.  Brazilian developers are some of the best in the world, but their managers, in general, suck, both at their jobs and as people.  They seem constitutionally incapable of adhering to an agenda for more than a week, and chaos, gossip, inefficiency, mysterious budgetary shortfalls, and missed deadlines are the norm.  But they will feel no qualm about scapegoating you for whatever goes wrong, and no one will protect you, because you, as a foreigner, are not "one of the boys".  You will recognize "the boys" in a matter of days - they're the smiley untouchables who laugh, talk, and goof off for hours at a time while you're trying to get things done. 

While technical education here can be first-rate at some schools, in general, MBA-type education is unbelievably bad.  At one above-board MBA program here, the final project needed to earn your degree is not something that tests your knowledge of accounting, inventory management, marketing strategies, or any of the topics you'd study at business schools.  It is ... wait for it ... a collage.  As in, cutting out pictures from magazines and pasting them on a paper board.  But these people are your superiors, period.  So if you work at a local company, you will effectively be working for delusional, sociopathic man-children with 8-th grade educations and no logical or critical thinking skills whatsoever.

The best software developer I have ever worked with is a Brazilian.  He has had trouble sustaining employment for longer than a year and a half - although after he gets fired his companies come begging him to return, because he was the one getting most of the work done.  In one of his jobs, he was asked to investigate the quality of the company's database.  In his submitted project, he reported that about 60% of the rows in the database were unusable.  He was promptly fired, and no efforts were made to repair the database.

I am very sorry to be harsh to my adopted country.  But I have lived and worked here long enough to earn the right to speak my mind.  I do enjoy the non-work parts of living here - Brazil has a certain joie de vivre that makes the US seem drab, unfriendly, and depressing.  For me, it is the country with the best parties, the best friends, the best weather, and the best (affordable) food.  I know this is an illusion to cover up a very sordid reality, but it is a very beautiful one.  But the fact remains that Brazil is the country of the future.  Think about what that means for a second.  The future is, by definition, unreal.  Once it becomes real, it's not the future anymore, it's reality.  And reality is always disappointing.  Brazil loves the future, but it is so beautiful, so pristine, so precious, that it cannot be allowed to happen.  If you make the mistake of trying to make it happen, every knife will be aimed at your back.

If you want to post a job offer or if you are looking for a job, please post on the Brazil Jobs section.